Supercache, eAccelerator and WordPress – Benchmarks

Donncha who is one of the developers behind the hugely popular WordPress software released his new project yesterday. As I’m always looking to squeeze any extra performance out of my site that I can I had to give it a whirl. The very page that you are looking at now is served to you by WordPress, eAccelerator and even cached through a Squid proxy server.

So Donncha claimed that it could really squeeze some extra performance so naturally I had to put it to the test and I was hugely impressed by the results. I set up a test server here and installed a brand new default installation of WordPress. The server itself is a 3Ghz P4 with 2GB of RAM running stock installs of Apache, PHP and MySQL. Once I installed WordPress I just left it as is with just the default single entry.

I decided to compare results against a default installation, with supercache and with supercache and eAccelerator. To do this I used another PC on my LAN and used the Apache bench command to compare each scenario serving up 1000 pages. Like this:

ab -n 1000 http://172.20.1.11/index.php

After each test I restarted apache and viewed the page in a browser to get it into cache.

First up the stock install with no caching:

Time taken for tests: 161.000 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 5123000 bytes
HTML transferred: 4885000 bytes
Requests per second: 6.21 [#/sec] (mean)
Time per request: 161.000 [ms] (mean)
Time per request: 161.000 [ms] (mean, across all concurrent requests)
Transfer rate: 31.07 [Kbytes/sec] received

Secondly, WordPress and supercache:

Time taken for tests: 5.718750 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 5262892 bytes
HTML transferred: 4978960 bytes
Requests per second: 174.86 [#/sec] (mean)
Time per request: 5.719 [ms] (mean)
Time per request: 5.719 [ms] (mean, across all concurrent requests)
Transfer rate: 898.62 [Kbytes/sec] received

Finally with supercache and eAccelerator:

Time taken for tests: 2.531250 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 5263000 bytes
HTML transferred: 4979000 bytes
Requests per second: 395.06 [#/sec] (mean)
Time per request: 2.531 [ms] (mean)
Time per request: 2.531 [ms] (mean, across all concurrent requests)
Transfer rate: 2030.22 [Kbytes/sec] received

So it is pretty conclusive, A combination of supercache and eAccelerator is the way to go.

Nov 7th, 2007 | Posted in Blog, Linux, Networking, Technical, Web
Tags:
  1. Nov 7th, 2007 at 17:25 | #1

    What about testing the WP-Cache part of the plugin? Disable the Super Cache (and delete the cache just to be sure) in the backend admin page. Should be interesting.

    Thanks for benchmarking it :)

  2. Nov 7th, 2007 at 17:27 | #2

    That was fast! I only posted about 10 mins ago!

    That is a good idea. I never thought about that. I’ve deleted the setup since but I’m going to have a bash off it tomorrow.

    I’m a sucker for benchmarks so I just had to compare :)

  3. Nov 8th, 2007 at 14:47 | #3

    holy shit I must install that

  4. Nov 8th, 2007 at 15:01 | #4

    Might be well worth your while installing it Dan. eAccelerator is a breeze to install and once it is enabled in your php.ini that’s it all done. If you are using a distribution it is all done for you automatically.

  5. Nov 8th, 2007 at 16:45 | #5

    Your ab test is with only one request at a time.

    Try running your tests with ab again using the -c option, for the number of concurrent connections to use. With -c using something 10 or greater I’d think.

  6. Nov 8th, 2007 at 17:19 | #6

    Hi Joeseph,

    Thanks for the commment. I only wanted to run a quick and dirty test for the moment. I hope to benchmark it more thoroughly over the coming weekend.

  7. Nov 10th, 2007 at 04:19 | #7

    this cache is still working well on my 2.3 blog at http://www.probloggerwedding.com – thanks for the great plugin

  8. Nov 10th, 2007 at 10:59 | #8

    Hi,

    great benchmark test, thanks for it. One question, if i use super-cache/wp-cache and eaccelerator object-cache, should wordpress internal cache be activated or deactivated?

    thanks :)

  9. Nov 10th, 2007 at 12:08 | #9

    Hi Sara,

    I left both enabled for the last benchmark. It should work with both enabled. :)

  10. Nov 10th, 2007 at 18:37 | #10

    Hi, I am using super-cache but I still get CPU limit errors on my hosted server on BlueHost. Do you know how I can install e-accelerator on a shared server?

  11. Nov 10th, 2007 at 19:12 | #11

    I can modify ini.php, file permissions, and upload/delete files via FTP. I don’t have shell access only a control panel.

  12. Nov 10th, 2007 at 19:16 | #12

    Hmm. I’m not too familiar with some of the control panels I’m afraid. I so know that some have a package management feature. That might allow you to download and install it?

  13. Jan 4th, 2008 at 01:55 | #13

    A question. Was this test just with WP-Supercache and eAccelerator installed or did you also have ot use Neosmart’s eAccelerator plugin here to see the benifits of eAccelerator?

    I am curious because my host will install eAccelerator for free which is boon because it would probably be beyond my skills.

    Christopher – I just left Bluehost for that very reason. How many visitors and page views do you get daily? WP-Cache/Supercache got me up to the 3200k visitors and 15-22k pageviews a day but after that I would get at least one CPU exceed a day. Its shared hosting, it can only take so much. So I just left. Still waiting for the DNS to resolve my new VPS. :P

  14. Jan 4th, 2008 at 09:35 | #14

    Hi BlaKKJaKK,

    The test was performed with just a standard installation of eAccellerator and Super Cache. Thanks for the link though. I’m heading off to check that out now :)

  15. Dan
    Jan 22nd, 2008 at 14:17 | #15

    Hi Robert, did you ever have the chance to repeat the experiment with WP-Cache? I’d really like to know what the performance jump from WP-Cache to Super Cache is.

  16. Jan 22nd, 2008 at 14:22 | #16

    Hi Dan,

    Unfortunately I never got the chance to compare the two. However Donncha who wrote SuperCache has a detailed comparison of the two on his page. Might be worth checking it out.

    http://ocaoimh.ie/wp-super-cache/

  17. May 28th, 2008 at 11:24 | #17

    It looks really good, I must try the same at home.

    /Zaga Bjælkehuse – Denmark

  18. May 28th, 2008 at 12:11 | #18

    Wp Supercache from Donncha is really great and works like promised (and better than wp-cache2) – but i`m still waiting for Viper Cache from Duane for WordPress, which should (like benchmarks show) really kick ass.

    have a nice day

    Sara

  19. May 28th, 2008 at 12:15 | #19

    Viper Cache sounds interesting Sara. I’m just going to check it out now. Thanks for the tip.

  20. May 28th, 2008 at 12:21 | #20

    No Problem, Robert.. i`m still waiting to get my hands on it.. and because Duane is really in a lack of time (i think) it just got delays maybe.

    Viper Cache uses another way to cache than all other caching plugins do.. and we´ll see if it really takes wordpress to another performance level. If i`m right, the wordpress guys work on performance improvements and integrated google gear for the dashboard.. in 2.6 – it´s in the trunk already. working? i don`t know.. using firefox 3.1a and cannot use google gears because of that.

    i´m really interested in wp-super-cache (using it everywhere i`m runnig wordpress) and in viper cache – but it seems only special guys get their hands on it.

    have a nice day and excuse my bad english and long comment. :)

    sincerey

    sara

  21. May 28th, 2008 at 12:25 | #21

    There is nothing wrong with your English Sara :) Or the long comment..

    I’ve just been reading Duanes site and it some of the features he is building into it are interesting but I think that a combination of Donncha’s plugin and eaccelerator will provide the exact same performance as Duane’s plugin.

    But of course it is easier to manage just one plugin. I use eaccelerator because I have other non WordPress PHP based sites running on my server :)

  22. May 28th, 2008 at 12:33 | #22

    I’m looking forward to Duane releasing his plugin. He should put it up on the WordPress.org plugins db so people can grab his code and work with it.

  23. May 28th, 2008 at 12:55 | #23

    ok, then i go on trying to give my english a chance.. ;)

    I`m the same opinion, but without benchmarking it (i think the speed / benchmarks differ a lot from the different server/ini settings every user got..) we cannot say that for sure..

    i will sure give it a try in one of my blogs and use the apache benchmark to see if and how it differs from using an object cache like eaccelerator, apc, xcache.. and wp super cache.. but i`m waiting since weeks and i hope, his viper cache will soon be released to give it a testdrive.

    I was using eaccelerator, too, some months ago till the new versions and snapshots give me apache seg. faults.. so i decided to change to pecl APC and it runs fine.. of course, i use the object-caching for wordpress, but the wordpress-own caching enging (cache.php) seems to get better and better – of course, the changes to it in 2.5 were really improvements and needed.

    My little sweet Server hosts just small sites.. like my blog and 3-4 other wordpress blogs (i never found out what the group variable in the object-cache files is for.. default group ok.. every vhost its own groupname? seems to make no difference at all) and 2 bulletin boards, thats all.. no ideas for sites which could interest someone out there ;)

    finally i`m looking forward to the viper cache realease and the wp super cache upgrades (we forgot about 1blogcatcher which makes a good job, too) and object-cache improvements which will sure come sometimes. Google Gears is a no way for me speeding up the dashboard.

    have a really nice day :)

    nice greetings

    Sara

  24. Dan
    May 28th, 2008 at 13:07 | #24

    There’s also Hypercache available:

    http://wordpress.org/extend/plugins/hyper-cache/

    It claims to be the most “aggressive” cache plugin around, but it’s not clear how it works. Stability and security areimportant for me so I’m sticking with Supercache for now — I know it’s got a good active developer behind it and is being well looked after.

  25. May 28th, 2008 at 13:13 | #25

    Donncha – It looks promising alright. I’m tempted to get my hands on it to benchmark it and I agree that it might be worth Duane’s while putting it up on the plugins db. He might be surprised at just how much contribution the community could make to his project.

    Sara – Caching seems to be a sort of dark art :)

    The only cache on my webserver is eaccelerator. I decided not to install any wordpress caching plugins as I use Squid as a reverse proxy and http accelerator as a front end to all my sites and squid alone does an excellent job at speeding things up. Especially since this site (and my others) are connected with a mere 384kb line. Although this will soon be upgraded to 768k.

  26. May 28th, 2008 at 13:19 | #26

    Thanks for that link Dan.

    I have settled on my solutions at the moment but it is always good to see and test any other alternatives that are out there.

    Time to fire up my test server I think!

  27. May 28th, 2008 at 13:49 | #27

    I looked at hyper cache a few weeks ago. It’s similar to WP-cache, but it’s not quite as good and doesn’t do any file locking which could cause problems on busy servers.

  28. May 28th, 2008 at 15:13 | #28

    wow.. a nice discussion, i enjoy reading it.

    Robert, maybe i should give squid a try tonight and install it; i`m using no ssl on my server so i thought i could just do like not recognizing that something like squid is existing.. but if it gives normal httpd a (caching) performance boost, is really should have an eye on it – thank you very much for your hint about squid.

    I had a look at hyper cache plugin, too, and agree Donncha 100%. I was really happy when wp super cache 0.1 was released and i enjoy its development and further versions. The good thing about it (if we don`t talk about its performance) that a very good developer stands behind it (hi Donncha ;) ) and the comunity can discuss and contribute to it/him.

    Duane should really take his viper cache to the plugin area of wordpress so that we all can have a look and maybe help in further development.

    I´m searching for squid howtos now.. :)

  29. May 28th, 2008 at 15:23 | #29

    Sara,

    Squid is a huge undertaking and it is initially relatively difficult to get up and running. In my case I use it as a front end to direct traffic to other servers I have that do not have public IP addresses.

    It is by no means easy to setup and ideally you would need another server. I have an example of how mine is set up here:

    Reverse Proxy with Squid

    My own scenario is pretty unusual which is why I have it setup the way that it is. If all you want to do is accelerate PHP then the purpose plugins are the way to go.

    Hope this help :)

  30. May 29th, 2008 at 04:15 | #30

    Good morning, Robert,

    thank you very much for that link – i will have a look right now :)

    Hm, i tried Squid yesterday but it´s too big for my (caching) intentions and i`m not using any load balancing (and and..) so i stopped it and had a look at Varnish

    ( http://varnish.projects.linpro.no/ )

    which should have the best performance in proxy caching (that`s what they say and some other sites..), but Varnish gives me an error after running and changing the apache (listen) port..

    so i have to look at it today, again, why Varnish is not working like it should.

  31. May 29th, 2008 at 11:26 | #31

    Hi Sara,

    The problem you are having is probably a conflict between Varnish and Apache both wanting to use the same port.

    In thinking, I would definitely stick to using plugins. As we already know they will speed up wordpress for you.

    However if you have other PHP based non wordpress sites then it would certainly be worth it for you to look into PHP eAccelerator.

    Depending on which operating system your webserver is using there should be an install package for it. So you may not even have to download it you could just install it from your operating systems package manager.

    http://eaccelerator.net/

    Best of luck.

  32. Aug 27th, 2008 at 06:57 | #32

    Yes, that’s what I looking for. So far I made benchmarking on clean WordPress installation before and after turning on MySQL and PHP caching. The gain was about 150%. Next step is to install WordPress caching module. On the other hand, if you use shared host, Wp-cache or super cache is the only solution because you cannot install APC on that host. Thank you!

  33. Aug 27th, 2008 at 09:14 | #33

    I’m glad you found it of interest. I just had a look at your own ‘make it faster’ entry and I found it very interesting too. Thank you for your hints as well ;)

  34. Sep 26th, 2008 at 15:10 | #34

    Is the supercache still the best option? The post is quite old and I am now looking into it.

  35. Sep 26th, 2008 at 16:52 | #35

    Donncha’s plugin WP Super Cache is under constant development and is getting much better with each release so it is still one of the best options out there :)

  36. Jan 21st, 2009 at 23:56 | #36

    Is this information still good or is there an updated post with current information?

  37. Jan 22nd, 2009 at 01:27 | #37

    It’s as good as it’s going to get! I only ran a quick and dirty benchmark but the results proved that there is a benefit to be gained but your scenario might not be the same as mine.

    If time allows I will try to run another benchmark but I can say that in the time since I ran that benchmark I haven’t had any issue with performance. It has been much better than I expected.

    I would suggest trying WPsuper cache first if you are running a wordpress blog. However if you are running other php based software then it might be worth trying a php pre-compiler like eaccelerator.

    Hope this helps!

  38. Jan 22nd, 2009 at 10:32 | #38

    I took a quick look at Hyper Cache. It has a few problems and doesn’t have all the features of supercache.
    Both plugins use the same method of capturing the current page, but there’s an obscure bug in WordPress that isn’t really fixable in that if query_posts() is used more than once in a theme then the 404 status is lost. I fixed that a while back in my plugin.
    It only seems to cache for anonymous users, not logged in or users who left a comment. That’s fine though because 99% of your users will be anonymous, mostly.
    It doesn’t do any file locking either, although I’m considering removing the file locking from supercache, or making it optional because it screws up on some hosts.

    It does however support mobile user agents which is great, and I’ll probably copy that code into supercache (and credit Hyper Cache of course) soonish so at least in “half on” mode it’ll work properly with mobile phones.

    I do like how it’s written though. It’s much neater than supercache, and more encouragement for me to reorganise my plugin!

  39. Vito Botta
    May 4th, 2009 at 22:09 | #39

    Those numbers are impressive, but if I understood rightly you ran te bench from another PC in the same LAN, correct?
    With eAccelerator together WP Super Cache Plus (on WP 2.7.1), I can’t go over 37-38 requests per second, running the bench from my pc at home (so not in the same LAN).
    Are these numbers OK or should I expect better figures?
    Thanks in advance

  40. Vito Botta
    May 4th, 2009 at 23:17 | #40

    Oops…. the numbers are in fact much lower, at around 2 requests/sec!
    (I had made a mistaken with the previous tests)
    What can this depend on? How can I improve things and what shall I expect instead?
    Thanks!

  41. May 4th, 2009 at 23:23 | #41

    Hello Vito,

    My benchmarks were run on a LAN. If you are testing from home to your webserver then you will not get an accurate result because you will be limited by the speed of your internet connection.

    Running a benchmark from home to a webserver over the internet would not be recommended as the results would not be accurate!

  42. Morgan
    Aug 16th, 2010 at 22:08 | #42

    Comparison of WordPress and other popular CMS http://allbenchmarks.com/p/cms-group-test
    Not so good. I don’t know about supercache, but APC was used.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Bad Behavior has blocked 2217 access attempts in the last 7 days.

22 queries. 0.760 seconds.