Configuring Memcached Session with Moodle 3.2.1

Re: Configuring Memcached Session with Moodle 3.2.1

Sergio Rabellino
Number of replies: 2
Particularly helpful Moodlers 사진 Plugin developers 사진

Sure, I was talking about memcache as the "Memcache Server" itself, not the php extension used.

In reply to Sergio Rabellino

Re: Configuring Memcached Session with Moodle 3.2.1

TC TC

We had problems with Redis and session locking handling. We have faced the same problems with memcached too:


[28-Feb-2018 18:12:32 Europe/Berlin] Cannot obtain session lock for sid: e9g9mt3294u0grq5ft4adr124h within 120. It is likely another page has a long session lock, or the session lock was never released.

[28-Feb-2018 18:12:32 Europe/Berlin] Default exception handler: error/Unable to obtain session lock Debug:

Error code: Unable to obtain session lock

$a contents:

* line 366 of /lib/classes/session/redis.php: core\session\exception thrown

* line 258 of /lib/classes/session/redis.php: call to core\session\redis->lock_session()

* line ? of unknownfile: call to core\session\redis->handler_read()

* line 42 of /lib/classes/session/handler.php: call to session_start()

* line 124 of /lib/classes/session/redis.php: call to core\session\handler->start()

* line 77 of /lib/classes/session/manager.php: call to core\session\redis->start()

* line 785 of /lib/setup.php: call to core\session\manager::start()

* line 45 of /config.php: call to require_once()

* line 5 of /course/view.php: call to require_once()


Our configuration is as follows:


#$CFG->session_handler_class = '\core\session\redis';

#$CFG->session_redis_host = 'XXXXX';

#$CFG->session_redis_port = 6379;  // Optional.

#$CFG->session_redis_database = 0;  // Optional, default is db 0.

#$CFG->session_redis_prefix = $CFG->dbname.'.sess.key.'; // Optional, default is don't set one.

#$CFG->session_redis_acquire_lock_timeout = 120;

#$CFG->session_redis_lock_expire = 7200;

#$CFG->session_redis_serializer_use_igbinary = true;


Are you experiencing these problems with memcached or Redis too?


Thank you very much in advance


In reply to TC TC

Re: Configuring Memcached Session with Moodle 3.2.1

Daniel Neis Araujo
Core developers 사진 Particularly helpful Moodlers 사진 Plugin developers 사진 Translators 사진

Hello


for the one that are experiencing problems with Memcached, I've followed the instructions on MDL-53947 and it worked well.

It is an incompatibility from the memcached php extension. On Ubuntu 16.04 the available lib was out-of-date. Using the latest version from the github repository fixed the error.

평균 등급 :Useful (1)