PHP 的两个 memcache 扩展:memcache 和 memcached(一)
来源:互联网 发布:java接口命名规则 编辑:程序博客网 时间:2024/06/10 05:57
从手册上明显可以看到这两个扩展:
http://php.net/manual/en/book.memcache.php
http://php.net/manual/en/book.memcached.php
在Q群里问了下,没有人能分辨出它们的差别,甚至有人怀疑我说的 Memcached 是 Memcached 服务器(守护进程)。
从手册上看,memcached 会比 memcache 多几个方法,使用方式上都差不多。
看看严谨的老外们怎么说的:
http://stackoverflow.com/questions/1442411/using-memcache-vs-memcached-with-php
Memcached client library was just recently released as stable. It is being used by digg ( was developed for digg by Andrei Zmievski, now no longer with digg) and implements much more of the memcached protocol than the older memcache client.
memcached 实现了更多的 memcached 协议(毕竟是基于 libmemcached 库的)。
http://serverfault.com/questions/63383/memcache-vs-memcached
As Nate’s link suggests, both work perfectly well for simple usage. However, memcached supports more features that allow you to get the most performance out of memcached. The binary protocol reduces the amount of data required to be sent between client and server. Multigets and multisets allow you to get/set multiple items at the same time. If you’re finding you need more oomph out of memcache, memcached is the better module. The use of libmemcached suggests that the library itself is possibly more optimised than the PHP only version.
Memcached is a more recent module compared to memcache, having only been released 8 months ago. If you need to target an older version of PHP, then you can only really use memcache.
memcached 的版本比较新,而且使用的是 libmemcached 库。libmemcached 被认为做过更好的优化,应该比 php only 版本的 memcache 有着更高的性能。
这里有另外一个对比表,很明显,用 memcached 会让人放心很多:
http://code.google.com/p/memcached/wiki/PHPClientComparison
差别比较大的一点是,memcached 支持 Binary Protocol,而 memcache 不支持,意味着 memcached 会有更高的性能。不过,还需要注意的是,memcached 目前还不支持长连接:
pecl/memcached does not support failover or persistent connections. This is quite annoying, since I’m sure the underlying libmemcached C library supports both.
pecl/memcache does not have the very handy getServerByKey() method, which is immensely useful when debugging.
在这里,我推荐大家使用 memcached
- PHP 的两个 memcache 扩展:memcache 和 memcached(一)
- php的两个memcached扩展:memcache和memcached(二)
- PHP 的两个 memcache 扩展:memcache 和 memcached
- php的两个memcached扩展:memcache和memcached
- PHP扩展memcache和memcached的区别
- php的memcache和memcached扩展区别
- php扩展Memcache和Memcached的区别
- php的memcache和memcached扩展区别
- php的memcache和memcached扩展区别
- php的memcache和memcached扩展区别
- PHP的两个memcache扩展 memcache和…
- php的两个memcached扩展 memcache…
- php安装memcache和memcached扩展
- Memcached和PHP-Memcache扩展安装
- 关于Windows7 下面安装memcached和php的memcache扩展
- Linux下部署Memcached和PHP的Memcache扩展方法
- 关于PHP扩展memcache和memcached的区别
- php扩展memcached和memcache的安装配置方法
- fedora16看rm,mp3的方法
- C++ primer第二次阅读学习笔记(第11章:泛型算法)
- xp与linux之间的文件传输
- 一个不错的手工php注入教程
- 十四周任务二
- PHP 的两个 memcache 扩展:memcache 和 memcached(一)
- php的两个memcached扩展:memcache和memcached(二)
- 比较两个数大小
- 下一站天后
- Android Activity的启动方式
- Everyday life inspires me——加拿大流行天后艾薇儿经典语录(中英对照)
- STL中map用法详解
- 一句话评论设计模式六大原则 (转自老毕)
- 第十四周C++【任务二】关于动态链表