PHP扩展memcache与memcached的差别

WBOY
Release: 2016-06-13 11:54:28
Original
1073 people have browsed it

PHP扩展memcache与memcached的区别

1. memcached简介


memcached是高性能,分布式的内存对象缓存系统。

PHP操作memcached服务有两个扩展 memcache 和 memcached。


2. memcache扩展


memcache扩展支持面向对象和面向过程两种接口。

它的函数受php.ini影响,所以必须在php.ini配置文件中设置。

该扩展出现时间较早(2004年)。

php.ini配置:

[memcache]extension = memcache.somemcache.allow_failover = "0"memcache.hash_strategy = "consistent"memcache.default_timeout_ms = 100
Copy after login


3. memcached扩展


此扩展使用了libmemcached库提供的api与memcached服务端进行交互。

所以安装时需要先安装libmemcached库。

memcached扩展只支持面向对象的接口。

安装时不需要在php.ini中配置,只引入 extension即可。

该扩展出现时间较晚(2009年)。

memcached功能比memcache更全,支持的函数更多。


3. 使用哪个扩展


推荐使用memcached扩展。

memcached功能更全一点。


4. 具体对比不同点


下面一张表对比具体的不同点,地址:

https://code.google.com/p/memcached/wiki/PHPClientComparison




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!