Use of memcached in 2.0

Use of memcached in 2.0

by Ashley Holman -
Number of replies: 1
Hi,

I noticed that dmllib in 2.0 no longer uses record caching like it did in 1.9. This seems fair because the 1.9 implementation only cached very specific calls to get_record(), namely those which queried based on 'id' alone.

I did a test on 1.9, loading /course/view.php with memcached/rcache turned on and it still did 150+ DB queries with only 2 memcache hits.

Has there been any discussion about implementing memcache at a higher level in Moodle core libraries, eg. calls to accesslib and moodlelib. For example, get_all_sections($courseid) - this whole object could be cached. So 50 students loading a course would only cause 1 DB query. There would have to be careful attention paid to make sure the cache is kept up to date, but some core tables are only modified in a few core library functions so it could be done reliably.

From reading about large-scale LAMP apps like Facebook, it seems they have implemented memcache very effectively to cache a very high percentage of lookups, which helps reduce the cost of scaling the DB server.

Just interested to hear peoples thoughts on this.

Cheers
Average of ratings: -
In reply to Ashley Holman

Re: Use of memcached in 2.0

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Hello,
yes more specific caching is definitely planned, it should be the last step in 2.0 or first 2.1 smile

There are several candidates - database sessions, guest capabilities, configuration, etc.