memcached problem

memcached problem

by Aditya Dubay -
Number of replies: 7

 

Hi I am using Moodle 3.3.1

I am trying to apply memcache and getting below error:

memcached extension is not loaded
Error code: sessionhandlerproblem
* line 123 of /lib/classes/session/memcached.php: core\session\exception thrown
* line 73 of /lib/classes/session/manager.php: call to core\session\memcached->init()
* line 785 of /lib/setup.php: call to core\session\manager::start()
* line 35 of /config.php: call to require_once()
* line 32 of /lib/ajax/service.php: call to require_once()
memcached extension is not loaded
Error code: sessionhandlerproblem
* line 123 of /lib/classes/session/memcached.php: core\session\exception thrown
* line 73 of /lib/classes/session/manager.php: call to core\session\memcached->init()
* line 785 of /lib/setup.php: call to core\session\manager::start()
* line 35 of /config.php: call to require_once()
* line 32 of /lib/ajax/service.php: call to require_once()
Average of ratings: -
In reply to Aditya Dubay

Re: memcached problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

What is says...

The memcached client code is not installed in your PHP. How you fix that depends on (most likely) your operating system and how PHP was installed in the first place. 

In reply to Howard Miller

Re: memcached problem

by Aditya Dubay -

Hi Howard,

Thanks for reply.

Memcache is installed on server. Please find attached image.

 

Regards,

Attachment memcache.png
In reply to Aditya Dubay

Re: memcached problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

"memcache" is;  "memcached" is not. The 'd' is very important. 

They are two completely different things - despite the terrible choice of names. You need the "memcached" client (which is often harder to find for some reason)

Average of ratings: Useful (3)
In reply to Aditya Dubay

Re: memcached problem

by Jeff White -
What Howard said on fixing your issue.


I would recommend using Redis instead of memcached as it pretty much obsolete. You also dont need to spend 10 minutes explaining the difference between memcached and memcache in every meeting. 

Average of ratings: Useful (2)
In reply to Jeff White

Re: memcached problem

by Aditya Dubay -

Hi Jeff

Thanks for reply

Does Redis can handle large websites of moodle?

Right now we have 11000 students who are appearing in examination and soon this count will reach 60000.

As per moodle session handling page memcached is fastest so we are trying to install that in our server.

In reply to Aditya Dubay

Re: memcached problem

by Jeff White -

Redis is extremely scalable and fault tolerant to meet even the largest websites. You will need to learn Redis to make some of the more complicated set ups but it should be worth the effort. 


I was very close to using Redis with my new Moodle environment I am building out but I discovered using a faster shared storage location pretty much nullified any of the benefits to using a dedicated Redis server cluster. Your needs might benefit from Redis but you got to test, test, test to find these things out.  See this post I made over this for more info: https://moodle.org/mod/forum/discuss.php?d=354259 

Average of ratings: Useful (3)
In reply to Jeff White

Re: memcached problem

by Aditya Dubay -

Hi Jeff,

Finally we install Redis and test it.

In case of "Store request when used as session cache" the "Session cache" looks better then Redis?

We face lots of "invalidsesskey" problem before, does it resolve with Redis?

Please find attachment and suggest.

Also we have around 10 moodle instances running on server for different clients so what we set in config.php of each instance? Right now in one instance we set:

//Redit session handling

$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host = '127.0.0.1';
$CFG->session_redis_port = 6379; // Optional.
$CFG->session_redis_database = 0; // Optional, default is db 0.
$CFG->session_redis_prefix = ''; // Optional, default is don't set one.
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;

Also who to configure Redis for "Store requests when used as a request cache." right now it says "Unsupported mode".

 

Thanks in advance.

Attachment redis-2.png
Attachment redis-3.png
Attachment redis-4.png