什么会导致本地APC比远程Memcached慢


What could cause local APC to be slower than remote Memcached?

我正在努力调整我的缓存,在做基准测试时,我发现了一些让我感到困惑的东西。

从我的远程Memcached盒(本地网络)提取密钥需要0.0008秒,而从我的本地APC缓存提取密钥需要0.0114秒。是的,它整整快了14倍。

对于本地缓存来说,这似乎太慢了…我应该在调优中考虑哪些设置以使其更有效?

编辑:按要求,这是我的APC配置从php.ini
[APC]
;specifies the size for each shared memory segment will need adjustment for your environment.
apc.shm_size=8
;max amount of memory a script can occupy
apc.max_file_size=1M
apc.ttl=0
apc.gc_ttl=3600
; means we are always atomically editing the files
apc.file_update_protection=0
apc.enabled=1
apc.enable_cli=0
apc.cache_by_default=1
apc.include_once_override=0
apc.localcache=0
apc.localcache.size=512
apc.num_files_hint=1000
apc.report_autofilter=0
apc.rfc1867=0
apc.slam_defense=0
apc.stat=1
apc.stat_ctime=0
apc.ttl=7200
apc.user_entries_hint=4096
apc.user_ttl=7200
apc.write_lock=1

通过apc_fetch('my_key');

好好利用你的记忆!尝试将apc.shm_size提高到128mb -这是一个简单的调整,可以大大提高性能。此外,考虑更改apc.user_entries_hint以适应您的应用程序的需求-参见apc与自定义mmap扩展。

可辨识链接:
APC vs自定义Mmap扩展
http://2bits.com/articles/importance-tuning-apc-sites-high-number-drupal-modules.html