eAccelerator WordPress Object Cache

Rollin', rollin', rollin'...

Hot on the coat-tails of the plugin formerly known as eAccelerator WP-Super Cache, we would have liked you to be present at the ceremonial release of the all new 'eAccelerator WordPress Object Cache'.

Our inability to get the invites out in time however, means that you missed the ceremony and will have to get up to speed using this lack-lustre blog post instead.

 

What?

This eAccelerator backend is based on Ryan Boren's memcached backend and eAccelerator for WordPress from NeoSmart.net.

At the time of writing, the NeoSmart eAccelerator backend is old and doesn't work nicely with the latest versions of WordPress. Specifically; it doesn't implement the non-persistent groups. Caching these objects in a persistent fashion (longer than the current page view) results in some rather odd behaviour.

Additionally, the NeoSmart implementation of wpcache_flush() is somewhat aggressive in its approach to chucking out absolutely everything that's cached on the server - including compiled scripts. Fortunately, it probably won't work since it uses an eAccelerator admin function that is dependent on the value of eaccelerator.allowed_admin_path. Unfortunately (in the doesn't work scenario), flushing the cache is useful.

 

The new version here is better because...

  • It implements the current WordPress Object Cache API including global and non-persistent groups.
  • It doesn't chuck everything out of eAccelerator when the cache is flushed.
  • It doesn't use any any eAccelerator admin-only functions.
  • It doesn't claim to boost your server performance to the limit (see below).
  • Some other stuff that escapes me right now.

 

View: object-cache.php

Download: object-cache.zip

To install, copy file to wp-content/object-cache.php

 

Don't say I didn't warn you...

On a single server blog installation with MySQL query caching and nothing beyond the core WordPress objects being cached, using this will probably make page generation SLOWER than not using it.

Don't just assume that this will make your blog faster.

 

Tune in next time for something or other.

 

  • Reddit
Back to top ↑

Activity

RSS
68 total comments, leave your comment or trackback.
  1. Carlos Andrade

    Oct 29th 2008
    #

    I´m tryin to activate your plugin, the following error appears.

    Fatal error: Cannot redeclare wp_cache_close() (previously declared in /htdocs/wordpress/wp-includes/cache.php:43) in /htdocs/wordpress/wp-content/plugins/object-cache.php on line 33

    My wordpress version is 2.6.1 Could you please help me?
    Something similar appears on activating “super cache plus”


  2. Murmatron Server Admin
    Admin Avatar
    Oct 30th 2008
    #

    object-cache.php isn’t a plugin in the conventional sense and shouldn’t be in the plugins directory.

    It goes in the wp-content directory and WordPress will immediately start using it. It doesn’t require activation – it just needs to be there. To deactivate it, you delete or rename it.


  3. Murmatron Server Admin
    Admin Avatar
    Oct 30th 2008
    #

    Something similar appears on activating “super cache plus”

    Well spotted – I’ve released a new version 0.6.2.


  4. Carlos Andrade

    Oct 30th 2008
    #

    Ok. Now it seems ok but … in eaccelerator statics no cache keys appears for me.

    What kind of functions use it, in wordpress?


  5. Murmatron Server Admin
    Admin Avatar
    Oct 30th 2008
    #

    Most (but not all) database query results are cached.

    Searching the WordPress source for wp_cache_add will show you what gets cached.

    As to why you’re not seeing any cached keys – I’ve no idea. You should be seeing something like this.


  6. Ian

    Oct 30th 2008
    #

    Can this plugin be used in conjunction with the regular SuperCache plugin??


  7. Murmatron Server Admin
    Admin Avatar
    Oct 30th 2008
    #

    Can this plugin be used in conjunction with the regular SuperCache plugin?

    The Object-Cache (caches database query results) and SuperCache (caches pages) are completely separate and don’t conflict with each other at all. So; Yes.

    Don’t forget the warning in the red box up above though. SuperCache (either Donncha’s or mine) will improve performance, but the Object Cache may well make page generation slower.


  8. Ian

    Oct 30th 2008
    #

    Thanks for the quick answer. I am aware of that and I am checking the page generation times for performance. So far so good.


  9. ovidiu

    Nov 13th 2008
    #

    hello.
    how would I know if this is working?
    I have the file inside wp-content and all is well, but how do I know its working together with eaccelerator?

    Besides, what does this mean: On a single server blog installation with MySQL query caching and nothing beyond the core WordPress objects being cached, using this will probably make page generation SLOWER than not using it.

    I have my own dedicated server, using eaccelerator and the apache mem_cache module. The server hosts a lot of wordpress isntallations and one wpmu isntallation. Does it make sense to put this object-cache.php into every blog and into the wpmu installation? Most of the wordpress blogs and even the wpmu installation don’t need wp-super cache or your modified version of it.

    For object-cache.php to work, do I need this line in wp-config.php? define(’ENABLE_CACHE’, true);

    Do I have to delete this line from my experiments with wp-super cache? define(’WP_CACHE’, true);

    Thx.

    Btw. I have got an idea for an article you could write about some things that have always confused me: I have never fully understood how disk caches, object caches, apache’s mem cache and eaccelerator work together :-)


  10. ovidiu

    Nov 13th 2008
    #

    one more issue:
    on my wpmu install I ma using this plugin: h**p://wpmudev.org/project/WPMU-Sitewide-Feed-Plugin—ITDamager which tells me this warning when I use your object-cache.php file: NOTE: Your WPMU is not using WP Object Cache. Performance will be degraded and site load increased. Please use the object cache for maximum performance. If I use this one: http://neosmart.net/dl.php?id=14 it doesn’t give me this warning anymore.
    What could be wrong? is your plugin not working or does this sitewide feed plugin just fails to detect it?


  11. Murmatron Server Admin
    Admin Avatar
    Nov 13th 2008
    #

    ovidiu,

    I’ve enabled the object-cache.php on my server, so you can see that it does actually work as advertised.

    The only way to know it’s working is to look inside eAccelerator’s key cache:

    eAccelerator Cache for this Virtual Host (thats a stripped down version of the control.php that comes with eAccelerator.)

    You’ll see the SuperCached stuff in there too.

    According to the WordPress source, the inclusion of object-cache.php doesn’t depend on any defines at all. The file just has to be in the wp-content directory.

    However, at the beginning of my object-cache.php I test for the availability of the eaccelerator_put API function just like in my SuperCache plugin. If it’s not available, it falls back to normal WordPress (no object cache) behaviour – the only other option would be to proceed with a PHP Fatal Error and that’s not good.

    The bit about making a site slower is simple to explain. A single blog install under low to moderate load probably won’t hit the database hard and fast enough to reap any benefit from the WordPress object-caching (caching the results of DB queries) and suffers a performance penalty from having to do extra PHP work on each page generation.

    Where the object cache will win the day is on big sites with lots of active discussion, big MU installions and mass hosting, all of which have the potential to hammer the database into submission. Slower page generation beats no page generation at all.


  12. ovidiu

    Nov 13th 2008
    #

    ok, thx for explaining. I think I understand now. This object cache wouldn’t make sense if I only had one blog, but hosting several blogs and an wpmu install justifies using the object cache.
    I am just wondering if I can keep my setup like it is:
    apache using the mem_cache module with 32MB of cache, mysql has query cache enabled too, I think its 16MB or 32Mb too and eaccelerator has its own 32MB cache assigned.
    Would this benefit if I gave i.e. all 10 blogs I hsot and the wpmu install the object cache? wouldn’t that make any other caches obsolete? And wouldn’t that crowd the eaccelerator cache too much?

    Besides it seems its not working for me, I cleared/purged the cache now and still only the normal stuff inside :-( see screencast here: http://screencast.com/t/iwSU1qfln72 don’t know why but your plugin is not picking up my eaccelerator install ;-( I installed by hand according to this: http://eaccelerator.net/wiki/InstallFromSource and my configuration inside php.ini is like this: http://screencast.com/t/hYzLmYeq

    It seems in older wordpress versions where the object cache was built in you needed that define inside the wp-config file.

    I hope we can sort this out and I really appreciate your help.


  13. Murmatron Server Admin
    Admin Avatar
    Nov 13th 2008
    #

    I’m going to be busy for a while, but probably later today I’ll have a little test.php that will show all the details of how PHP is seeing the eAccelerator (and others) extension – which functions are available and which are not, whether required functions are available etc.

    I don’t know how useful it will be at arriving at a solution, but at least it’ll let folks see clearly what my plugins are looking for and require in order to work.

    I’m not ignoring the rest of your comment – I’ll read it in more detail later and try to respond but I have to shoot out the door now.


  14. Murmatron Server Admin
    Admin Avatar
    Nov 13th 2008
    #

    ovidiu,

    I really don’t think the object-cache makes other types of caching obsolete.

    WP-Cache / SuperCache full content caching has a huge effect even if isn’t all the time.

    I develop and test the SuperCache-Plus plugin on a lovely old P4-600E with IDE disks just because it’s slow and magnifies the performance gains and losses. It does ~0.5 second page generation but serves 75 requests-per-second from the eAccelerator WP-Cache and 190 from the static SuperCache. That’s a minimum of 150 times faster on a cache hit – there’s no reason on earth to not want that gain.

    MySQL query caching is good, but relies heavily on good schema, index and query design. It still requires connection to the database server though – how many times have you see MySQLToo Many Connections errors on your travels around the internets? WordPress had a reputation for terrible database and query design, but a lot of work has gone in there and I think it’s pretty good now. I see good cache hit-rates on my db server. Plugins are another story – there’s a lot of plugins out there that have queries that would make a grown man weep. Unfortunately, few plugins (I haven’t seen any, but I’m not a plugin junkie) use WP object-caching so you’re screwed either way with those.

    If you’re hosting blogs you’ve got to assume the worst. There’s always going to be someone that has 50 badly written plugins installed or some other means of generating 500 queries in a 15 second page generation time. I’ve actually seen a blog article about WordPress optimisation where the author was proud to get generation time down from something like 12 seconds to 4.

    Anyway, I digress. The object-cache saves the database from collapse in times of stress – for example full page caching effectively reduces the database queries to zero when nothing is changing, but you have to purge stuff from the cache when something changes e.g. comments are posted. Op-code caching, query caching and object caching become your friend at this point. It all adds up – they save each other from being inadequate in isolation.

    Anyway, I could explain this all a bit better if I took more time – bottom line is that the different types of caching do different things, but also work together.

    Actually, this is all getting a bit convoluted and I suspect that I’m failing to address your question – I’m probably on the verge of having had too much wine to be writing coherently about this stuff.

    I’ll give serious consideration to penning an in-depth article about it all. I’m not saying that my world-view is the be-all and end-all and I certainly don’t want to set myself up as an ‘expert’ on the subject, but I have seen some real bullshit written in and around the subject.

    I now feel compelled to (metaphorically) sign off for the day, have a nice glass of Port or two and watch ‘The Thomas Crown Affair’ (again) on TV – after I disable that damned object-cache that’s slowing my server down :)


  15. ovidiu

    Nov 14th 2008
    #

    :-) thx that was a very nice summary which helped me understand caching a little better. You can certainly put me on your mailing list in case you’ll ever publish a more intense article about this.
    I’ll be waiting for your test.php as Ireally want to get this object cache working ;-)


  16. ovidiu

    Nov 14th 2008
    #

    oh, I just remembered, there are two php.inis one for the command line another one. I usually never bother to edit the cli one so maybe thats why your plugin is not picking up eaccelerator?


  17. Ovidiu

    Nov 14th 2008
    #

    working now, as stated in your other post. can I ask you for another huge favor please?
    I’ve got one pretty important plugin on my wpmu isntall, which can’t seem to notice that your object-cache plugin is working. the plugin is this one: http://wpmudev.org/project/WPMU-Sitewide-Feed-Plugin—ITDamager and this seems to be its cache check:

    function check_cache() {
    global $wp_object_cache;
    return (is_object($wp_object_cache) && $wp_object_cache->cache_enabled == true) ? true : false;

    but I might be completely wrong, I have not that much knowledge about coding :-( I guess I coudl always modify the if statement where it checks for the cache, but that could be done a lot more better so please if you can give me a hand with this, I’d be extremely thankful.


  18. Murmatron Server Admin
    Admin Avatar
    Nov 14th 2008
    #

    I’ve added and changed what I think should satisfy the wpmu-sitewide-feed plugin, so try it now.

    Actually, what wpmu-sitewide-feed is doing is a bit cheeky and no version of object-cache that I’ve looked at has both those class members that it’s accessing. Ryan Boren’s memcached implementation (which I considered to be the defacto standard with respect to what’s required) has cache_enabled but not expiration_time.

    Having said that; I know next to nothing about WPMU.


  19. Ovidiu

    Nov 14th 2008
    #

    :-) perfect
    many,many,many,many thanks to you.


  20. MegaBurst

    Nov 20th 2008
    #

    Nice stuff – we will be doing some benchmarking soon and results will follow. Good work though!


  21. ovidiu

    Dec 3rd 2008
    #

    I am just wondering why your stats look like this:
    80:1:wp-supercache:file:c10ad4587b03ddd219a954a63fc5669b.gzip 2008-12-03 11:08 7.685KB 2008-12-03 17:08
    80:1:wp-supercache:meta:c10ad4587b03ddd219a954a63fc5669b.gzip 2008-12-03 11:08 0.697KB 2008-12-03 17:08
    80:1:wp-supercache:meta:a49b53441c2dc80d07363c4aa473fd26.gzip 2008-12-03 11:04 0.747KB 2008-12-03 17:04
    80:1:wp-supercache:hits 2008-12-03 11:09 0.073KB none
    80:1:wp-supercache:file:524f202f47b4f3325008e0ca346e2ff8.gzip 2008-12-03 11:09 5.858KB 2008-12-03 17:09
    80:1:wp-supercache:file:a49b53441c2dc80d07363c4aa473fd26.gzip 2008-12-03 11:04 11.605KB 2008-12-03 17:04
    80:1:wp-supercache:init-time 2008-12-03 00:44 0.078KB none
    80:1:wp-supercache:misses 2008-12-03 11:09 0.075KB none
    80:1:wp-supercache:meta:524f202f47b4f3325008e0ca346e2ff8.gzip 2008-12-03 11:09 0.762KB 2008-12-03 17:09
    sess_a86b47bce69e314cb6a0eff867b875ac 2008-12-03 01:22 0.095KB expired
    80:1:wp-supercache:304s 2008-12-03 05:14 0.073KB none

    while mine only look like this:

    :80:1:wp-supercache:misses 2008-12-03 08:45 0.081KB none
    :80:1:wp-supercache:init-time 2008-11-27 06:59 0.084KB none

    ? there are a couple of wordpress isntallations enabled both with wp suepr cache plus and your modified wordpress object cache. Is this normal?


  22. ovidiu

    Dec 3rd 2008
    #

    oh, btw, what settings for eaccelerator are you using? mine are:
    eAccelerator
    eAccelerator support enabled
    Version 0.9.5.3
    Caching Enabled true
    Optimizer Enabled true
    Memory Size 33,554,396 Bytes
    Memory Available 13,036 Bytes
    Memory Allocated 33,541,360 Bytes
    Cached Scripts 596
    Removed Scripts 0
    Cached Keys 551

    Directive Local Value Master Value
    eaccelerator.allowed_admin_path /var/www/web1/web/eaccelerator.php /var/www/web1/web/eaccelerator.php
    eaccelerator.cache_dir /var/cache/eaccelerator /var/cache/eaccelerator
    eaccelerator.check_mtime 1 1
    eaccelerator.compress 1 1
    eaccelerator.compress_level 9 9
    eaccelerator.content shm_and_disk shm_and_disk
    eaccelerator.debug 0 0
    eaccelerator.enable 1 1
    eaccelerator.filter !*rotate.php !*PEAR.php !*rotate.php !*PEAR.php
    eaccelerator.keys shm_and_disk shm_and_disk
    eaccelerator.log_file no value no value
    eaccelerator.name_space no value no value
    eaccelerator.optimizer 1 1
    eaccelerator.sessions shm_and_disk shm_and_disk
    eaccelerator.shm_max 0 0
    eaccelerator.shm_only 0 0
    eaccelerator.shm_prune_period 3600 3600
    eaccelerator.shm_size 32 32
    eaccelerator.shm_ttl 3600 3600

    am I missing something or have I mis-configured my settings?


  23. Murmatron Server Admin
    Admin Avatar
    Dec 3rd 2008
    #

    Several possible reasons I can think of…

    1. Nothing getting cached in there because you have the No-Cache for registered users turned on.

    2. Namespacing – By default, eAccelerator is supposed to namespace Virtual Hosts so the location of control.php dictates what you see – If it’s in the server root you’ll see everything – If it’s in a VHost root you’ll only see what’s cached by that VHost.

      Personally, I’ve never seen that default behaviour working (on Windows – YMMV) and namespace the VHosts manually.

      The colon at the start of the key does however suggest to me that you’re looking at namespaced data (my stats page is tweaked to trim the colon off.

    3. The stuff has expired and been cleaned – the object-cache stuff default expiry is 600 seconds.

    4. Something isn’t working right. :-(

    5. Some combination of the above.

    Incidentally, the No-Cache for registered users plugin is currently preventing SuperCache expiry – I’ve just released a fix for that.


  24. ovidiu

    Dec 3rd 2008
    #

    - tried from another browser as well, where I wasn’t logged in, nothing changed
    - don’t understand the full explanation, but above what I cut and pasted, are of course entries like Cached scripts
    Filename MTime Size Reloads Hits ↑
    /var/www/web5/web/wp-content/mu-plugins/my_options.php 2008-11-18 09:17 0.87 KB 1 (0) 9692
    /var/www/web6/web/wp-content/plugins/wp-supercache-plus/storage/eaccelerator.php 2008-11-15 08:31 37.97 KB 1 (0) 6145
    /var/www/web6/web/wp-content/plugins/wp-supercache-plus/wp-cache-base.php 2008-11-18 11:35 5.98 KB 1 (0) 6143
    I was just wodnering why you also have “wp-supercache:file” stuff in your cached key section… and I see cached files from different vhosts, so that is working well, sorry for the confusion
    - this is not valid as I tried jsut before checking the eaccelerator stats page
    - dunno about this
    ————————————————–
    thx for the fix. for details about what my eaccelerator stats page looks like right now see here: http://screencast.com/t/TMkNXmjDyU


  25. Murmatron Server Admin
    Admin Avatar
    Dec 3rd 2008
    #

    I’ll try and explain the first one a bit better so you know exactly what to look for and expect…

    There’s 2 caches – WP-Cache (in your case eAccelerator keys) and SuperCache (static files).

    There’s 2 types of users – Registered/Cookied and Non-Cookied.

    If both caches are enabled, Cookied users go in WP-Cache. Non-Cookied users go in SuperCache. Each cookied user get their own copy of each page in WP-Cache.

    If the SuperCache is disabled, everything goes in the WP-Cache.

    However; as a consequence of the above – if the SuperCache is enabled and the No-Cache for Registered (cookied) Users plugin is active, NOTHING will ever be cached in the WP-Cache. This is what I think you are seeing.

    This behaviour is different from Donncha’s original WP-SuperCache where everything is always cached in the WP-Cache and duplicated for non-cookied users in the SuperCache – I am of the firm belief that the duplication is a waste of time and space (the WP-Cached file will never be served if a SuperCache duplicate exists, so what’s the point in having it) – so I removed it.

    The wp-supercache:file stuff you see in my cached keys are the cached page views from registered (me) and cookied (you) users since I don’t have the No-Cache plugin active.


  26. Murmatron Server Admin
    Admin Avatar
    Dec 3rd 2008
    #

    Ovidiu

    I see your problem now – Check out your aAccelerator Memory Usage / Free Memory.

    You aren’t going to get anything more in there unless you throw some more RAM at it.


  27. Ovidiu

    Dec 24th 2008
    #

    k, sorry for the late reply, but I was on holiday. BUT I thought the eaccelerator.shm_prune_period 3600 3600
    eaccelerator.shm_ttl 3600 3600 values would help eaccelerator kick out unneeded or unused entries and automatically make room for the more frequently used entries? Do you suggest other values for these settings?


  28. Murmatron Server Admin
    Admin Avatar
    Dec 24th 2008
    #

    I think the problem with WordPress in that respect is that there isn’t much chance for scripts to be infrequently used – a hit to the home page of this site compiles 97 scripts and uses about 10M – so I don’t think you’re going to be able to rely on ttl and prune to leave memory for caching keys.

    You seem to have a lot going on in /var/www. By my estimation, every one of those WP instances could easily generate over 15M of compiled scripts in eAccelerator.

    It’s easy for me on this box – I’m running a single WP production site (this) and a few other bits and bobs like SquirrelMail. The compiled scripts never get beyond ~20M (about 15M of that is WP) so the 32M I have allocated never gets filled.

    I suspect that the only eAccelerator ini setting that’s going to be of any help to you is eaccelerator.shm_size :( As things are now, you’re not even getting all your scripts cached.


  29. ovidiu

    Jan 12th 2009
    #

    :-( but then how are big providers doing this? I mean a default hosting provider has some 100 clients on his servers, if anyone of those uses a single wordpress installation, eaccelerator, x-cache or zend would never actually be of any use and as far as I know providers do offer these tools :-(

    I mean I host around 10 wordpress and one wpmu installation so my 32MB of cache assigned to eaccelerator are of no use, right?


  30. Murmatron Server Admin
    Admin Avatar
    Jan 12th 2009
    #

    That’s a good question (hosting providers) and I’m not sure that I know the answer.

    I’ve seen providers listing eAccelerator or similar and have always had a bit of a WTF? moment since it seems entirely possible that in the absence of quotas, a single customer on a shared server could (with or without intent) grab all the shared memory on a first come first served basis.

    I suppose that from the provider’s perspective it’s still reducing the server load even if it’s only working for one or two customers.

    Meanwhile; XCache seems to be the only one that has separate settings for the var cache which at least prevents compiled scripts from blocking key storage, but that still doesn’t address the issue of equitable sharing.

    Perhaps there is some clever way of managing all of this, but I’ve never seen it documented for any of the shared memory caches.


  31. ovidiu

    Jan 19th 2009
    #

    just wanted to let you know I haven’t found out anything new about the issues mentioned in my last post, regarding web hosters and eaccelerator.

    BUT I want to thank you for the warning box further up here, saying that: using this will probably make page generation SLOWER than not using it :-)

    I had some performance problems with my personal site, which only gets in high traffic times 2-5 visitors in parallel. As soon as I had more than 2 visitors to my site, i.e. browsing the picture gallery, the server load would rocket from 0.5 to around 40!!!

    I spent 2 month reading every mysql, apache2 and wordpress tuning tip and only now remembered the object cache plugin I was using.

    Deleting this file brought page generation times down from 0.9 seconds to 0.2 seconds.

    So I can confirm, that on my server where there are only wordpress sites (5-10) and one wpmu install, and nothing beyond the core WordPress objects is being cached, this plugi ndegrades performance.

    This is in no way a complaint, I just wanted to confirm your warning :-)


  32. ovidiu

    Jan 19th 2009
    #

    oh, and btw. here is a very good tool I used to analize my website: http://blogs.icta.net/plugins/wptuner


  33. Murmatron Server Admin
    Admin Avatar
    Jan 19th 2009
    #

    Closely related to the slippery subject of WP object caching, I’ve been messing around with an addition to my SuperCache that sits somewhere between the object/query caches and the full page cache.

    It allows (via manually replacing the calls to the_content and comment_text in theme files since I haven’t found a better way to do it) caching of the rendered comments and posts after all plugins have done their work on them.

    In my experience, plugins and their liberal use of preg_replace and similar are often responsible for the biggest part of page generation time.

    It’s now working with eAccelerator key storage on this site and brought the render time of my SuperCache post which has 90 or so comments down from 3.5 seconds to around 0.5 seconds. That gain is almost entirely due to the plugin filters not being run on the content.

    It needs lots more work and I’m not sure how (or if) I can get it to work with WP2.7’s new wp_list_comments() comment loop. That, plus the fact that it requires manual theme modification with a fair bit of smarts applied makes me wonder if it would be wise to release it.


  34. ovidiu

    Jan 21st 2009
    #

    just wondering, after having stopped using this object cache on all wordpress sites on the server if I should also stop using it for the wpmu site? can you advise, after reading my previous two posts were I describe the situation?

    Speedwise, as measured with wp tuner, there is almost no difference in terms of speed with or without the plugin, so I am not sure what to do…


  35. Murmatron Server Admin
    Admin Avatar
    Jan 21st 2009
    #

    My gut feeling without ever having tested anything is that MU is more likely to benefit from the object-cache than WP is.

    Having said that, I’m seeing an increasing number of issues raised where the established wisdom of installing [insert name of]-Cache to make your blog[s] fly is being challenged when things start to get big.

    For example, there’s a WP support topic where SuperCache is starting to drag things down on a 700K per day site because of the number of files that need cleaning up. Using my SuperCache with the memcache-alt backend in HALF-ON mode could solve that guy’s problem instantly. With that setup, garbage collection isn’t necessary and removing old content when something changes takes a few milliseconds even if there are tens of thousands of cached pages.

    And therein lies the problem – this blog works fine with with my eAccelerator storage and since its hosted on my home ADSL (o_O) it’ll get hammered off the net long before the scalability of that becomes an issue. The usage patterns of different sites will produce radically different results. A site that gets a [digg | slashdot | reddit]ing on a single post will clearly benefit from having a SuperCached static file to serve, whereas if something like ICanHazCheezBurger was a standalone blog with SuperCache it might well get wiped out due to the amount of disk activity generated by the thousands of retarded (in the nicest sense of the word) users mashing their keyboards in the comments threads.

    What I’m basically saying is that there are so many variables, the only way is to try stuff and see if it works. What doesn’t work well now, may work next year when the site is bigger. And what works well now may start to collapse as things grow.

    tl;dr version: I don’t know.


  36. ovidiu

    Jan 22nd 2009
    #

    :-) I really enjoy reading your comments, thx.

    I’d like to ask you another only partially related question:

    do you ever see Removed scripts in your eaccelerator control panel?

    I don’t :-(

    I also see Cached keys 257 but then when I scroll down to the cached keys section, I only see:

    Cached keys
    Name Created Size ttl
    :80:1:wp-supercache:304s 2009-01-21 00:53 0.079KB none
    :80:1:wp-supercache:misses 2009-01-22 14:17 0.081KB none
    :80:1:wp-supercache:init-time 2009-01-12 10:55 0.084KB none

    but when I check in the backend of your plugin, it says that caching occurred :-( I am now wondering if I have eaccelerator configured right :-(


  37. Murmatron Server Admin
    Admin Avatar
    Jan 22nd 2009
    #

    Mystery solved. Your comment went into the spam queue for some reason. I knew there was a post because I was looking at my logs, but when it didn’t show up I thought it was because I’d broken something.

    Removed Scripts – No, I’ve never seen anything there.

    I’m guessing that the total is correct and the other cached keys are from another Virtual Host – To see everything at once you’d need to be running the eaccelerator control script from outside of any Virtual Hosts.


  38. ovidiu

    Jan 23rd 2009
    #

    :0 you are right, you shouldn’t see anything there as you are using 32MB cache for just this one site :-( but I should, as eaccelerator is enabled for all vhosts…

    The eaccelerator control page script is indeed inside one vhost but in the cached scripts list I see other vhosts cached scripts as well..

    nevermind. I think I am fine as is :-) I’ll just leave things as they are now


  39. Murmatron Server Admin
    Admin Avatar
    Jan 23rd 2009
    #

    I have an eAcc control script in each of my php vhosts. No scripts get listed for those, just the keys cached for that vhost.

    I also have one served off of /htdocs which is the one pointed to by eaccelerator.allowed_admin_path and there I see absolutely everything – all scripts and keys for all vhosts.


  40. ovidiu

    Jan 23rd 2009
    #

    interesting.
    I had put the one pointed to by eaccelerator.allowed_admin_path into one of my vhosts for convenience. never occurred to me I might not be allowed to see everything..

    will move it during the weekend and check again. thx.


  41. ovidiu

    Jan 27th 2009
    #

    just had a look at this plugin and came up with a questio nregarding this line:

    include_once(ABSPATH.WPINC.'/cache.php'); // Fall back to default WordPress object cache

    I thought the wordpress object cache has been removed from the core?


  42. Murmatron Server Admin
    Admin Avatar
    Jan 27th 2009
    #

    It’s still there, but it doesn’t cache persistently – only to php arrays. The functionality to persist the data on disk was removed.

    It makes sense to always have the cache functions available so that the core code is cleaner. The alternative would be a mess of checks like if(function_exists('wp_cache_get'))

    The changes to SuperCache that I’m working on have been leading me back into the object-cache territory and I’ve been wondering why it makes my site slower. That new DB-Cache plugin makes my site slower too – I’m also wondering why that’s the case.

    I’ve found a work-around for the NetBeans bug that killed the debugger, so I can get back to finding answers.


  43. ovidiu

    May 7th 2009
    #

    do you have any idea where I can get an object cache version that works with disk files or x-cache instead of eaccelerator?

    I changed servers and had to go with x-cache instead of eaccelerator…


  44. Murmatron Server Admin
    Admin Avatar
    May 8th 2009
    #

    The only ones I’m aware of are the ones at NeoSmart.net, but last time I looked they didn’t support ‘Non Persistent Groups’ and would be prone to cause weird behaviour on a current version of WordPress.


  45. ovidiu

    Jun 8th 2009
    #

    hi there.
    Donncha is looking for an object cache plugin for wpmu 2.8: http://ocaoimh.ie/2009/05/26/looking-at-a-wpmu-object-cache/ and I highly recommended to also have a look at yours.
    Now I was wodnering about his question: `Did you try that object cache with MU? I haven’t tried it but it’s easier to poison the cache in MU because of the blog switching it does.`

    because until now I had no problems, but sometimes there is a little weirdness: I activate a plugin, it says activated, later when I visit the plugins page, the plugin is deactivated, sometimes I have to activate again, sometimes, it will appear as activated by itsself, could this be due to some problems with the kezs beeing cached to eaccelerator and confusing the blog ids maybe?


  46. Murmatron Server Admin
    Admin Avatar
    Jun 9th 2009
    #

    I haven’t tried it with MU. I’ve just had a look at it and it uses the blog_id for all keys except the global groups.

    What I’m guessing could be a problem is where eAccelerator automatically namespaces the keys for Virtual Hosts. Like I’ve said elsewhere, I’ve never actually seen that happen, but it’s supposedly default functionality and probably doesn’t work for me because of Apache 2.2/Windows/Some other reason.

    That would cause each Virtual Host to have a copy of the global groups. I don’t think that would break anything, but it’s not a very efficient use of SHM.


  47. retsek

    Jun 10th 2009
    #

    I’m in the same situation as when you described icanhazcheeseburger and the 700k site.

    We post about about 50 posts per day and they get many comments. Running the latest versions of eAccellerator and the Super Cache, but it still isnt producing good results. We had enable lock down, because we moderate like 250 comments every 4 hours or so. MYSQL goes insane, so enabling lockdown is the only to get through that.

    Any tips ?


  48. Murmatron Server Admin
    Admin Avatar
    Jun 10th 2009
    #

    retsek,

    As far as I see it; for sites like that, the only sensible approach is to cache as much as possible and throw away as little as possible.

    It’s my opinion that the generic SuperCache system isn’t really very good at handling sites that change often and as an attempt to address that, the version of SuperCache that I’m working on (not as fast as I’d like to be working on it right now due to other priorities) will allow (the SVN version already does) caching of individual blocks within a page – e.g. individual comments, widgets, footers etc. – that makes page regeneration much faster and easier on the database. Here’s an article about it.

    Unfortunately it requires modifications to the theme to take advantage of the extra caching and it’s not really production ready – although to be fair, it’s running on this site with no problems.


  49. ovidiu

    Jul 5th 2009
    #

    just a quick question: I am trying to integrate bbpress with a wpmu installation, and if I follow step8 from this howto: http://www.cssjockey.com/general/deep-integrating-wordpress-271-and-bbpress-0904 I get this error in conjunction with your eaccelerator wp object cache:

    [warn] mod_fcgid: stderr: PHP Fatal error: Call to a member function add_global_groups() on a non-object in /myabspathhere/web/wp-content/object-cache.php on line 74

    can you help out? or is it something bbpress would have to solve?


  50. Murmatron Server Admin
    Admin Avatar
    Jul 5th 2009
    #

    I’ve rummaged through the bbPress code and have made a small change to my object-cache that I think should accommodate bbPress.

    I’m not sure why bbPress is doing what it’s doing , but the change that I’ve made is trivial, so I don’t really care who’s right.

    Anyway; download the updated version and give it a go.


  51. ovidiu

    Jul 5th 2009
    #

    thx that worked :-)


  52. Ray

    Aug 18th 2009
    #

    Hi Murmatron,

    I’m migrating from NeoSmart’s eAccelerator object-cache plugin and am looking at using yours.

    Got the same question ovidiu had:
    http://murmatrons.armadillo.homeip.net/features/eaccelerator-wordpress-object-cache#comment-121

    So we do not need to define WP_CACHE in wp-config.php?

    Also, question for ovidiu:
    -How is performance with this eAccelerator cache on WPMU?

    We’re going to be using this with BuddyPress, WPMU and bbPress.


  53. Murmatron Server Admin
    Admin Avatar
    Aug 19th 2009
    #

    Ray

    Correct. The WP_CACHE define has nothing to do with the object cache.

    If object-cache.php exists in the wp-content directory, WordPress loads it. That’s all.


  54. ovidiu

    Aug 19th 2009
    #

    to be honest, this object cache was making my wpmu installation hum along BUT I had some problems, which seemed to disappear after I removed it. I am not sure they are related, but you can check it out as well.

    The problems I encountered, to my, it seemed to come from cached keys being assigned to wrong users or some such thing, i.e. I would activate a plugin, normally or sitewide, then go back to the plugin page and it would still say the plugin wasn’t activated, had to do it a couple of times to get it right…

    might be unrelated though…


  55. Murmatron Server Admin
    Admin Avatar
    Aug 19th 2009
    #

    I haven’t really done much work with the object cache or MU, but I suspect that ovidiu’s experience could well be typical.

    I think (but I’m not sure) that there may well be plugins (particularly in MU) that would need to be ‘object cache aware’ to function correctly.


  56. Ray

    Aug 20th 2009
    #

    I did run into some plugin problems earlier yesterday when I clicked “deactivate” for a plugin, but it simply wouldn’t deactivate; the plugin was still activated.

    Also, when I upgraded a plugin, the plugins page still showed the old version number, but the plugin was indeed upgraded when I checked out its settings page…

    Any idea why?

    Ovidiu, I also noticed that you are using the Super Cache Plus plugin that Murmatron is working on. Do you experience these same issues with that plugin? What type of setup are you currently using for caching? Since your setup (WPMU-related) is close to my own.


  57. Ray

    Aug 20th 2009
    #

    I should further note that the problems I experienced this on was on a WAMP package called “The Uniform Server”.

    While using a linux box, Murmatron’s object cache did not seem to have these problems… it could be the way eAccelerator is being configured on the WAMP box.


  58. Murmatron Server Admin
    Admin Avatar
    Aug 20th 2009
    #

    Ray,

    Check the eaccelerator.check_mtime ini setting on the setup that showed the old plugin version number.

    I suppose it’s possible that changes in recent WordPress versions may require changes in the object cache. Unfortunately, I haven’t much time to check that sort of thing out right now.


  59. ovidiu

    Aug 21st 2009
    #

    @RAY:

    the super cache plus plugin is working perfectly. mind that I am using his “stable” version, not the experimental one!!!
    Even if turning that plugin off, the same issues with the object cache plugin remain…


  60. Ray

    Aug 21st 2009
    #

    If you don’t mind me asking, what settings are you using for Super Cache Plus?
    I would like to try this out.


  61. Murmatron Server Admin
    Admin Avatar
    Aug 22nd 2009
    #

    My settings?

    This site is running the latest dev version (naturally) with the following settings:

    eAccelerator storage
    Half-On mode (no SuperCache)
    Expiry Time: 21600 (6 hours)
    Compression: On
    Last-Modified: On
    Cache-Control: On

    Also, the following config file settings are used:

    define('WPSCP_GC_MULTIPLIER', 6);
    define('WPSCP_EXPIRED_TTL_MULTIPLIER', 4);
    define('WPSCP_FRAGMENT_TTL_MULTIPLIER', 2);

    Additionally, the theme is treated for fragment caching.


  62. ovidiu

    Sep 16th 2009
    #

    @admin:

    could you spare a couyple of moments and have another look at the code fo the eaccelerator object cache plugin? Can you find any flaws that might be responsible for the problems I mentioned, like: I activate a plugin, then go back to the plugin page and it is still marked as deactivated?

    It looks like its serving me a cached option from the object cache? Any other possibilities for other users to be served cached objects or cached objects/keys of other users?


  63. ovidiu

    Sep 16th 2009
    #

    would you mind having a look at this one just to compare? http://neosmart.net/dl.php?id=14


  64. Murmatron Server Admin
    Admin Avatar
    Sep 16th 2009
    #

    There’s new functionality since 2.8 for handling ‘transient’ objects, but that doesn’t appear to be the issue – It’s object-cache aware.

    I honestly don’t see stale info anywhere on this site with the object cache enabled. It has to be something peculiar to MU. I’ll try and install MU later today because there’s no point in trying to guess it.


  65. Murmatron Server Admin
    Admin Avatar
    Sep 16th 2009
    #

    OK, I’ve got WPMU installed and everything with respect to individual blogs seems to work properly – objects are cached with the blog ID which is what I’d want to see.

    Now I need to look at the ‘global’ objects that don’t have a blog ID.


  66. ovidiu

    Sep 17th 2009
    #

    thx :-) you’re the man! besides I just found another problem: with this object cache plugin active, bbpress ceases to work. error log says:

    `mod_fcgid: stderr: PHP Fatal error: Call to a member function add_global_groups() on a non-object in …./object-cache.php`


  67. Murmatron Server Admin
    Admin Avatar
    Sep 17th 2009
    #

    … besides I just found another problem: with this object cache plugin active, bbpress ceases to work. error log says:

    `mod_fcgid: stderr: PHP Fatal error: Call to a member function add_global_groups() on a non-object in …./object-cache.php`

    I had just finished unzipping bbPress when I was suddenly taken over by a strange feeling that I’d been there before.


  68. ovidiu

    Sep 17th 2009
    #

    oh, no :-( sorry, I didn’t notice I was posting the same problem twice. So I now downloaded the plugi nagain and it says version 1.1

    al works. dunno, maybe I had the older version still isntalled. sorry for bothering you twice with that :-(


Leave a Reply

Comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <br> <cite> <code> <del datetime=""> <em> <i> <li> <ol> <p> <q cite=""> <strike> <strong> <tt> <ul> <pre lang="" line="">

Top of comments ↑

Search

There is much more rubbish here. Feel free to fritter upon the handy box supplied below.