is memcached any faster

Hello, I am wondering if anyone is still using memcached with elgg 2.3.3. It is easy to set up and already in the settings.php so I am wondering if any of you are using it and if so how is it or is it redundant with the simple cache/symlink thing already in the core (although I think simple cache just does static files not mysql instructions, but my newbie ignorance is why I am asking?). As well what about Redis? Any thoughts?

  • Memcached support is currently tested during continuous integration, so it's quite reliable. I have memcached running for several sites and it does greatly improve performance, especially if you are fetching entities that don't change often, e.g. a category tree, a list of groups etc.

    Simplecache - renders and caches static files
    Symlink - allows serving cached static files from the server without booting Elgg engine
    System cache - caches various system variables (e.g. a tree of views)
    Boot cache - caches config/datalist values to speed up engine boot (you can increase the TTL value in settings)
    Memcached - stores fetched database rows and reduces the number of queries needed to fetch all the data before rendering

    There is currently no Redis support, and I believe you won't be able to integrate it without hacking core files. You could use Redis from within plugins though.

  • I installed memcached and tried the settings.php file but getting a 500 error. I tried substituting my server name, ip address and localhost as server1 but still get the error. What would I put in this array:

    $CONFIG->memcache = true;

    $CONFIG->memcache_servers = array (
        array('server1', 11211),
    //    array('server2', 11211)
    );

  • My bad, I had to change to single server not servers:

    $CONFIG->memcache = true;

    $CONFIG->memcache_server = array (
        array('localhost', 11211),
    //    array('server2', 11211),
    );

  • You may want to add namespace as well, in case you have multiple sites using memcached. Otherwise there are key collisions and you end up wondering where did that come from.

  • I have elgg on it's own server and it will stay that way for now at least but can you give me an idea of what a namespace prefix would be for yoursite.com, or site name "Ablight Community"  if not domain for future reference? 

    ie:
        $CONFIG->memcache_namespace_prefix = 'yoursite.com';

    I don't know if it would matter in this case but I might be combining my elgg site and other mostly "static" website (with 2 small dbases) on the same server to see how it works for resource use such as both servers use php_fpm but having each site on it's own server takes memory and CPU for each instead of combined.

  • I think combined is the wrong word. I mean, to place both domain's (sites) on the same server.

  • i just enabled memcached in 2.3 after having disabled it for a while and can see a 100ms + reduction in processing time for MYSQL.

  • Namespace can be any string, but I would avoid special characters.
    You should feel improvements the longer memcached is running, as it will cache more entities. There is a stats table in admin overview somewhere

  • I am having a problem, I have installed memcached and it is showing up in the phpinfo.php so it is working but I can't get elgg to use it. In overview it says "Memcache is not setup on this server or it has not yet been configured in Elgg config. For improved performance, it is recommended that you enable and configure memcache."  My memcached ini is the following. As options I have tried 127.0.0.1, localhost, and my server IP address all to no avail so I have left it blank.

    PORT=”11211"
    USER=”memcached”
    MAXCONN=”1024"
    CACHESIZE=”256"
    OPTIONS=””

    and my elgg setting.php is:

    $CONFIG->memcache = true;

    $CONFIG->memcache_server = array (
        array('127.0.0.1', 11211),
    );

    ...any ideas on what could be wrong?

     

  • Did you try localhost instead of IP in Elgg config?

Performance and Scalability

Performance and Scalability

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