Memcache settings

I 'always had issues with memcached, but since very large sites as Twitter, Facebook and Google use it with success, it must be me. Installing and enabling it in ELGG is relatively simple.

The issues I have are that moving widgets in profiles is useless after enabling memcache since this will not be written into the DB.

Having multiple instances of ELGG on a single machine even gets the memcache server responding from the wrong database instance.

The documentation is somewhat limited on ELGG (just how to enable it in settings.php) Is there anyone using memcache with succes and knows what memcache.ini settings need to be set ?

I am testing with the latest "stable" version 1.4.15 of memcached combined with Elgg 1.8.16

At some point I really need this, since I am stretching the limits of all other performance improvements.

  • i don't know much about memcache - i do know that when i looked at activating it way back in v.1.7.4 elgg - that i concluded that i would need to manually add a lot of code to elgg for it to be effective, so i didn't do it.

  • I don't think that is needed in 1.8.16 since there is native support in classes to save and retrieve data.

  • ah ok, i haven't looked closely at the class files before. 

    i just installed memcached and the memcache php module on my local server.. activated memcached via command line.. uncommented the memcache lines in the elgg settings.php file. memcached is running.. yet i see no memcache activity when i browse my elgg install.

  • Use this small shell script to see if there is any real activity. If none, check your settings again

    #!/bin/sh
    watch 'php -r '"'"'$m=new Memcache;$m->connect("127.0.0.1", 11211);print_r($m->getstats());'"'"

  • ok, i ran that.. i'm not seeing any hits/misses.. though the connections field keeps increasing even though there 'should' only be me connecting to the server (since its my local one).

    am i right in thinking that you are seeing some hits/misses coming up in your terminal when you run the script?

  • FYI memcache module should come with memcache.php file printing nice statistics about hits and misses and allowing to browse stored data.

  • ah, that's useful, thanks. i found it.. now i see on that page: 

    Cant connect to:mymemcache-server1:11211

    so i will explore that.

  • Having multiple instances of ELGG on a single machine even gets the memcache server responding from the wrong database instance.

    I don't think Elgg currently supports sharing a memcache server with multiple Elgg instances. It isn't yet possible to configure site specific namespaces.

    I'm using memcache so far only on one server (dedicated to that Elgg client). There haven't been any issues so far. I will be installing another one within a couple of weeks. I'll share my experiences here once I get the second one working.

  • @gkanters Oh, and are you aware that php5-memcache and php5-memcached are two different modules. Elgg currently recommends php5-memcache. Are you sure you're using the correct one?

  • @gerard,

    we have memcache running with several clients. also running multiple elgg installations on 1 memcache server. For that we had to adjust 1-5 lines of code, so not that complicated.

    I remember there was an issue with users and loggin is, maybe we already fixed this in core I don't remember.

    I believe we also had some issues with moving widgets, but we fixed them in widget manager.

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.