General developer forum

 
 
Picture of Céline Perves
Moodle memcache setting
 

Hello,

got a question concerning memcache setting for Moodle

It is necessary to set session.save_path and session.save_handler = memcache in php.ini when you use moodle plugin cache memcache?

Thank you in advance

Céline Perves

 
Average of ratings: -
Picture of Céline Perves
Re: Moodle memcache setting
 

Most generally : someone can explain me how it works, how to correctly configure it

 
Average of ratings: -
Picture of Céline Perves
Re: Moodle memcache setting
 

I wan't to put session with memcache is it really implemented?

 
Average of ratings: -
Picture of Russell Smith
Re: Moodle memcache setting
Group Developers

We have memcache running sessions we have this implemented as a legacy session handler, local plugin.  It's configured to to use multiple memcache servers with failover.  We know the failover works as we use the system to patch memcache and our application nodes while the system is live. 

 

The gotcha is that it always uses the first memcached server that is up, so if one fails, you need the config to say the empty server to be listed second otherwise the sessions will assumed to not exist.

 

We've seen good performance with it as dbsession cannot handle our load.

 

 

 

 
Average of ratings: -
Picture of Céline Perves
Re: Moodle memcache setting
 

I would be very interested by your local plugin solution

 
Average of ratings: -
Picture of Céline Perves
Re: Moodle memcache setting
 

I configured well memcache server threw admin->plugin->cache :

adding a instance

entering test server in memcache setting

I changed "Stores used when no mapping is present" to work on memcache

But I had an error with performance test tool

for session cache memcache was not ready, only in my server not when testing on local

there was a notice error :

Notice: MemcachePool::delete(): Server 130.79.86.184 (tcp 11211, udp 0) failed with: CLIENT_ERROR bad command line format. Usage: delete

I found the solution on :

http://stackoverflow.com/questions/4745345/how-do-i-stop-phpmemcachedelete-from-producing-a-client-error

by adding a 0 timeout parameter to the delete memcache function on /cache/stores/memcache/lib.php l.283 :

    public function delete($key) {
        return $this->connection->delete($this->parse_key($key),0);
    }

 

 
Average of ratings: -
Picture of Wolf Ventir
Re: Moodle memcache setting
 

Are you able to speak about this any more or offer additional details? I am very interested in implementing such a thing. 

 
Average of ratings: -
Picture of Céline Perves
Re: Moodle memcache setting
 

are you interested by memcache installation or by Russell Smith solution?

 
Average of ratings: -
Picture of susan cheng
Re: Moodle memcache setting
 

Hi Céline,

We are thinking to move the session from database to memcache, is this supported by Moodle 2.4? Since I just see the session handling in memcache in Modle 2.6 documentation.

Another question, does memcache require an extra server or not, how big memory would required?

Could you explain more about what you did?

Thanks,

Susan

 
Average of ratings: -