2011-12-20 47 views
2

我正在努力调整我的缓存,并在做基准测试时发现了一些令我困惑的东西。什么可能导致本地APC比远程Memcached慢?

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

这似乎是一个本地缓存非常缓慢......我应该考虑什么设置调整,使其更有效?

编辑:按照要求,这里是在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的配置;

+0

您可能要包括你的APC的配置,并为获取 – ajreal 2011-12-21 04:38:38

+0

@ajreal代码 - 增加 – 2011-12-21 18:00:30

+0

如果它是一个小姐,每次则总是比一个慢缓存。 – Layke 2011-12-21 18:53:11

回答

相关问题