General help

Moodle Logout Issue

Moodle Logout Issue

system information:

Moodle version: 3.3.1+ (Build: 20170824)
Apache 2.4.16 / PHP 7.0.7 / Postgres 9.6.4
Load balanced over 8 servers plus 1 cron specific server

We recently made a few changes to our moodle infrastructure (upgraded moodle from 3.1 to 3.3, php from 5.4 to 7.0 and moved moodle sessions into memcached) and we've encountered a new problem.

When a user runs something in the web interface that takes some time - backing up a large course that takes around 4-5minutes to complete, moodle logs out whilst this goes on. I can replicate it 100% of the time. I have switched between having multiple memcached servers hosting the session cache to 1 server and it's not made a difference.

I'm interested if anyone knows anything about this issue, or if there are any suggested fixes.
Average of ratings: -
Picture of Howard Miller
Re: Moodle Logout Issue
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Is this a separate memcached from the MUC? 

To quote from the config file...

// Please be aware that when selecting either Memcached or Memcache for sessions that it is advised to use a dedicated
// memcache server. The memcache and memcached extensions do not provide isolated environments for individual uses.
// Using the same server for other purposes (MUC for example) can lead to sessions being prematurely removed should
// the other uses of the server purge the cache.
Average of ratings: -
Re: Moodle Logout Issue

Hello Howard,

Thanks for the quick response smile

Yes - it is indeed a separated memcached instance from the rest of the MUC. MUC runs on 11211 and session cache memcached on 11212. Would posting our config.php with some bits anonymised help?

Average of ratings: -
Re: Moodle Logout Issue

I'll post it anyway!

$CFG->dbtype    = 'pgsql';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'dbserver';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'moodle';
$CFG->dbpass    = 'password';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',

$CFG->wwwroot   = $wwwroot;
$CFG->dataroot  = '/moodledata/main';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

$CFG->passwordsaltmain = 'saltremoved';

$CFG->session_handler_class = '\core\session\memcached';
$CFG->session_memcached_save_path = 'ip1:11212,ip2:11212,ip3:11212,ip4:11212,ip5:11212,ip6:11212,ip7:11212,ip8:11212,ip9:11212';
$CFG->session_memcached_prefix = 'memc.sess.key.';
$CFG->session_memcached_acquire_lock_timeout = 120;
$CFG->session_memcached_lock_expire = 7200;

$CFG->tempdir = '/moodledata/temp';        // Files used during one HTTP request only.
$CFG->cachedir = '/moodledata/cache';      // Directory MUST BE SHARED by all cluster nodes, locking required.
$CFG->localcachedir = '/var/moodlecache';      // Intended for local node caching.
$CFG->preventfilelocking = false;

Average of ratings: Useful (1)