Benjamin fox
Benjamin fox

Reputation: 95

Issue with Memcached with session storing

Today i had to move to MemcacheD because of php7* .ver

after installing Memcached pecl for php7 i tried to store my session to Memcached but i saw it will take too much longer than default session store ( files )

Page load without Sess. Memcached < 200 ms

Page load with Sess. Memcached ABOVE 5 sec

And the problem is only with session ! i tried to store other datas in memcached and retrieved them asap without any lag or so.

My MemcacheD setting is:

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS="-l 127.0.0.1"

And my Pecl PHP Memcached Setting ( shown in phpinfo too ) is:

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

+ I checked with session_write_close() and the result was the same so i assume its not session lock problem

And the php is running with FPM unix socket if it is relevant

regards

Upvotes: 2

Views: 3343

Answers (1)

Benjamin fox
Benjamin fox

Reputation: 95

Problem was fixed by updating libmemcached 1.0.16 to 1.0.18 manually since the yum repos only had 1.0.16

With update now session store use memcached asap without any delay.

regards

Upvotes: 2

Related Questions