Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 是什么导致本地APC比远程Memcached慢?_Php_Memcached_Apc - Fatal编程技术网

Php 是什么导致本地APC比远程Memcached慢?

Php 是什么导致本地APC比远程Memcached慢?,php,memcached,apc,Php,Memcached,Apc,我正在努力调整我的缓存,在进行基准测试时,我发现一些东西让我非常困惑 从远程Memcached box(本地网络)中提取密钥需要0.0008秒,而从本地APC缓存中提取密钥需要0.0114秒。是的,它比以前快了整整14倍 这对于本地缓存来说似乎太慢了。。。我应该查看哪些设置以使其更有效 编辑:根据要求,这是我从php.ini获得的APC配置 [APC] ;specifies the size for each shared memory segment will need adjustment

我正在努力调整我的缓存,在进行基准测试时,我发现一些东西让我非常困惑

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

这对于本地缓存来说似乎太慢了。。。我应该查看哪些设置以使其更有效

编辑:根据要求,这是我从php.ini获得的APC配置

[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_提取(“我的_键”)完成

充分利用你的记忆力!尝试将apc.shm_大小提高到128mb——这是一个简单的调整,可以显著提高性能。另外,考虑改变<代码> APC.UsSeriTeNeXiSyt 以满足应用程序的要求。参见APC与自定义MMAP扩展。

相关链接:


您可能希望包括APC配置和获取代码。如果每次都未命中,则始终比缓存慢。