今天我因为php7 * .ver
而不得不搬到 MemcacheD在为php7安装Memcached pecl之后,我试图将我的会话存储到Memcached但我看到它将比默认会话存储(文件)花费更长的时间
没有Sess的页面加载。 Memcached< 200毫秒
使用Sess加载页面。 Memcached上传5秒
问题仅在于会话!我试图在memcached中存储其他数据并尽快检索它们,没有任何延迟。
我的MemcacheD设置是:
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS="-l 127.0.0.1"
我的Pecl PHP Memcached设置(也在phpinfo中显示)是:
extension=memcached.so
session.save_handler=memcached
session.save_path="localhost:11211"
[memcached]
memcached.sess_locking = On
memcached.sess_lock_wait_min = 1000;
memcached.sess_lock_wait_max = 2000;
memcached.sess_lock_retries = 10;
memcached.sess_lock_expire = 0;
memcached.sess_prefix = "memc.sess.key."
memcached.sess_persistent = Off
memcached.sess_consistent_hash = On
memcached.sess_remove_failed)
memcached.sess_remove_failed_servers = Off
memcached.sess_number_of_replicas = 0
memcached.sess_binary_protocol = On
memcached.sess_randomize_replica_read = Off
memcached.sess_connect_timeout = 1000
memcached.sess_sasl_username = NULL
memcached.sess_sasl_password = NULL
memcached.compression_type = "fastlz"
memcached.compression_factor = "1.3"
memcached.compression_threshold = 2000
memcached.serializer = "igbinary"
memcached.store_retry_count = 2
memcached.default_consistent_hash = Off
memcached.default_binary_protocol = Off
memcached.default_connect_timeout = 0
+ 我检查了session_write_close(),结果是一样的,所以我认为它不是会话锁定问题
如果相关的话,php正在运行FPM unix socket
问候
答案 0 :(得分:1)
通过手动将libmemcached 1.0.16 更新为 1.0.18 来解决问题已修复,因为yum repos只有1.0.16
现在更新会话存储使用memcached asap,没有任何延迟。
问候