we are implementing memcached servers for sessions.
But i don't know if moodle store the session in all memcached servers or only in one, if when this crashes, uses the other for storage data session.
During testing with two memcached servers i have seen that when only one memcached server crash the user lost it's session and is mandatory login again.
Is that way correct?
Thanks in advance
If you want that scenario to happen, meaning the session is still valid on failure, You would either need to use the plugin,
Or use Couchbase , http://www.couchbase.com/ for a replicated high availability memcache/d cluster. The only thing with Couchbase is that Moodle will throw a warning when trying to "flush all" because Couchbase by default has that function disabled. You would have to manually login to the Couchbase web app and flush the bucket so that it does it consistently throughout the cluster.
Thanks for the useful info
I am also trying to store the sessdata in memcache but i don't have idea how to enable this particuler table or field of database table. How did you implemented memcache for storing sessions in moodle(it means what are the files or functions do we need to change in source code of moodle ) ? can you give me any related links or give me procedure how to do ?
Please be very, very careful if you are using memcache for sessions. There is this bug: MDL-45375
Well, it is not really a bug, more a limitation of the memcache API. However, the up-shot is that if you are storing sessions in a particular memcache store, then you must not store any MUC caches in the same memcache store.
If you do, then any time that Moodle purges any memcache cache, every user will lose their session. And, it seems that Moodle does purge various caches in various places from time-to-time.
They are working on a warning for the admin notifications screen: MDL-45724.
Also, because of this bug, I just switched on server back from memcache sessions to DB sessions. Before doing that, I did a quick load-test, and I was surprised to find how similar the performance was between memcache sessions and DB sessions. Now this was on a very well-tuned Postgres database, but still food for thought.
(All the OU's busy sites are still on memcache sessions. In terms of Moodle scalability, the database is a single bottle-neck that is hard to scale. Hence, on a large a busy site, it does make sense to get the session storage off the DB server. However, if you are moving it to memcache storage, it must be a separate set of memcache storage, not shared with your caches.)
You need two instances of memcache running, e.g. on different servers or different ports.
Thank you Tim for your valuable information.
I created two different ports but now it is not created any logs in memcached.log.
Later, i came to know that data is not storing in memcache as shown above fig contains store value of memcache is 0. I installed memcached, php5-memcached, php5-memcache and i created two different ports with changing configuration files of memcached then also it is not storing any data in memcache.
where am i doing wrong ? please let me know
Does this bug also affect Memcached, or just Memcache?