我有一个群集的WordPress webapp,它使用一个由六个节点组成的Memcached群集来存储WordPress的对象缓存,但我似乎遇到了某种零星的Memcached设置/替换循环或缓存踩踏,偶尔会导致单个Memcached集群中的节点完全使Memcached和数据库网络链接饱和。
设置/替换循环或踩踏似乎是由于尝试“添加”WordPress“wp_:options:alloptions”键的大量尝试引起的,Memcached使用NOT_STORED回复所有这些特定查询。与此同时,大多数MySQL查询都是这样的:
SELECT option_name, option_value
FROM wp_options
WHERE autoload = 'yes'
我对Memcached Object Cache插件(http://wordpress.org/extend/plugins/memcached/)所做的唯一更改是默认的到期设置。
#var $default_expiration = 0; //original
var $default_expiration = 1800;
到目前为止,我已经能够通过增加Memcached守护程序最大连接限制来缓解此问题。我还将数据库存储引擎从MyISAM更改为InnoDB,并将APC shm_size从128M增加到1536M。
对象缓存是否设置/替换循环或踩踏不可避免,还是我当前设置的结果?
环境:
Memcached 1.4.14-1
PORT="11211"
USER="nobody"
MAXCONN="10240"
CACHESIZE="4096"
OPTIONS=""
PHP 5.3.28
memcache版本3.0.8 memcache support =>启用 memcache.allow_failover => 0 => 0 memcache.chunk_size => 32768 => 32768 memcache.compress_threshold => 20000 => 20000 memcache.default_port => 11211 => 11211 memcache.hash_function => fnv => FNV memcache.hash_strategy =>一致=>一贯 memcache.lock_timeout => 15 => 15 memcache.max_failover_attempts => 20 => 20 memcache.protocol => ascii => ASCII memcache.redundancy => 1 => 1 memcache.session_redundancy => 2 => 2 已注册的保存处理程序=>文件用户memcache
APC Version => 3.1.9 APC调试=>残 MMAP支持=>启用 MMAP文件掩码=> 锁定类型=> pthread互斥锁 序列化支持=>破碎 指令=>本地值=>掌握价值 apc.cache_by_default => On =>上 apc.canonicalize => On =>上 apc.coredump_unmap => Off =>离 apc.enable_cli => Off =>离 apc.enabled => On =>上 apc.file_md5 => Off =>离 apc.file_update_protection => 2 => 2 apc.filters =>没有价值=>没有价值 apc.gc_ttl => 3600 => 3600 apc.include_once_override => Off =>离 apc.lazy_classes => Off =>离 apc.lazy_functions => Off =>离 apc.max_file_size => 1M => 1M apc.mmap_file_mask =>没有价值=>没有价值 apc.num_files_hint => 1000 => 1000 apc.preload_path =>没有价值=>没有价值 apc.report_autofilter => Off =>离 apc.rfc1867 => Off =>离 apc.rfc1867_freq => 0 => 0 apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS apc.rfc1867_prefix => upload_ => upload_ apc.rfc1867_ttl => 3600 => 3600 apc.serializer =>默认=>默认 apc.shm_segments => 1 => 1 apc.shm_size => 1536M => 1536M apc.slam_defense => On =>上 apc.stat => On =>上 apc.stat_ctime => Off =>离 apc.ttl => 0 => 0 apc.use_request_time => On =>上 apc.user_entries_hint => 4096 => 4096 apc.user_ttl => 0 => 0 apc.write_lock => On =>上
答案 0 :(得分:0)