Getting the Best WordPress Performance

Wordpress Bechmark

In our previous PHP 7 vs HHVM benchmark, Benchmark Series 2: WordPress, we saw HHVM outperform PHP 7 by 7% on WordPress. That test was performed without any cache involvement to test pure HHVM and PHP 7 performance. But what about WordPress performance in a real world situation?

According to W3Techs’ usage report, WordPress is used by 24.3% of all the websites and holds 58.7% of the content management system market share. As the #1 content management system, we want to see how fast WordPress can be in a real world environment.

To this extent, LiteSpeed Technologies is currently developing our own WordPress cache plugin and are excited to share more information on this project as soon as it is available. In the meantime, a third party page caching solution, WP Super Cache, was used for this round of benchmarks. These benchmarks are using PHP 7, but are meant only as a WordPress benchmark.

Two cache modes in WP Super Cache were used for this test, “Use mod_rewrite to serve cache files” and “Use PHP to serve cache files”. According to their product description, “mod_rewrite” is the fastest and most recommended way to serve cache files as web servers would rather serve from static files instead of processing the heavier and more expensive WordPress PHP scripts. When using “php_mode”, caching will still be performed, but every request will require the loading of the PHP engine.

Neither WP Super Cache nor W3 Total Cache can use the default Permalink Settings, hence the URL list from the OSS Performance project has to be modified. We chose to use Numeric options which literally change the URL from http://192.168.0.61:8092/?p=123 for example, to http://192.168.0.61:8092/archives/123.

Since there are only 2 cores on our VPS test server, we turned off gzip compression for all web servers to help relieve some pressure on CPU and get a more accurate comparison. We are using LiteSpeed Web Server Enterprise for this test, however, OpenLiteSpeed has almost the same performance as our Enterprise version. This means you can replicate this benchmark on OpenLiteSpeed with similar settings and should get similar results.

Benchmark Server Configuration:
Typical VPS Server in an OpenVZ container
Running CentOS 7
2 cores of Intel(R) Xeon(R) CPU E5-1620 @ 3.60GHz
4G RAM
LiteSpeed Enterprise: 4.2.24
Apache: 2.4.6
PHP7- Version => 7.0.0-dev, Build Date => July 24 2015 – Git latest version -lsapi mod for LiteSpeed and php-fpm mod for Apache

WordPress Setup:
We use the same WordPress setup as in the OSS Performance project. OSS Performance is used to test the php performance, hence no page caching solutions. We have changed the WordPress Permalink Settings from default to Numeric and installed WP Super Cache.

Benchmarking Tools
Siege 2.78 is used for this test, just as it was for our previous WordPress benchmark. We used the following commands to simulated 10 concurrent users with 100 repetitions as well as 100 concurrent users with 1000 repetitions to simulate a higher traffic scenario:

siege278 -b -q -c 10 -r 100 -f wordpress2-cache.urls
siege278 -b -q -c 100 -r 1000 -f wordpress2-cache.urls

The WordPress url list is the same one as in the previous WordPress benchmark mentioned at the beginning of the article, with format changes to numeric style. The URL list is made up of 140 lines including long tail of posts, WP front pages, RSS feeds.

WordPress performance on LiteSpeed Web Server:
LiteSpeed+WordPress+Cache

As we can see, the use of a page cache makes a huge difference on WordPress performance. Using the siege command, we simulated 10 concurrent users with 100 repetitions and tested against WordPress without a page cache, with php_mode page cache, and with rewrite_mod page cache. With php_mode, pages are cached but still need to go through the PHP engine. This is 3000% faster than WordPress with no page cache. With rewrite_mod cache, WordPress runs 4400% faster than with no page cache.

Shall we dig a little deeper? What will happen if web traffic is higher? We again used siege to simulate 100 concurrent users with 1000 repetitions. This translates to 100,000 hits. The results were very interesting: instead of slowing down, LiteSpeed actually showed higher performance on the high traffic test with 7142.86 Requests/Sec. That is 5700% faster than WordPress with no page cache! This also further proves that LiteSpeed is the way to go when it comes to handling heavy traffic environments.

How does Apache compare? Let’s take a look.

WordPress performance on Apache Web Server:
Apache+WordPress+Cache

Without a page cache, Apache’s performance is very similarly to that of LiteSpeed. When using php_mode cache, WordPress runs 2200% faster than with no page cache. rewrite_mode runs at a similar speed to php mode, showing less of a performance gain than we initially expected. Apache’s weak ability to handle static files may account for this.

We then simulated 100 concurrent users with 1000 repetitions to again represent a higher traffic situation. WordPress performance dropped to 2594.71 Requests/Sec! In contrast LiteSpeed, as we showed earlier, saw a huge performance improvement of 7142.86 Requests/Sec. Apache’s server load for this test was 6.29 for our 2 core test VPS, while the server load for LiteSpeed when performing the same test on the same hardware was only 0.82. LiteSpeed’s ability to keep CPU load to a minimum was clearly a factor in reaching this higher performance even in a heavy traffic environment.

Conclusion:

Page cache makes huge difference on WordPress performance. Of course, PHP Opcode cache has been used for all of our benchmark tests which definitely improves PHP running time by a good deal. We also saw that in the cases of LiteSpeed and Apache, your choice of web server does make a noticeable difference in your overall WordPress performance! But what about Nginx? We will be doing more shoulder-to-shoulder comparisons between these top three popular web servers in the near future.

In our next benchmark, we will be validating whether or not HHVM is still faster than PHP 7 when WP Super Cache is being used. We think the results will be very interesting. How will WordPress performance differ between different web servers, with and without a page cache? When is choice of web server a factor? When is it not? Keep an eye out for “PHP 7 vs HHVM Benchmark Series 3: How fast can WordPress go?”.

What do you think about this test? What would you like to see next? If you have any feedback/comments/recommendations, we are keen to hear from you. Shoot us an email at info@litespeedtech.com.

Tags: , , , , , , ,

14 Responses to “Getting the Best WordPress Performance”

  1. Jon says:

    Any news about Litespeed build in WordPress cache plugin like LiteMage?

  2. Delboy says:

    Hi Michael

    Are you expecting your plugin to make WordPress websites load ‘much’ quicker than the plugins you have mentioned or will it just be slightly quicker at loading them…have you done any in-house test yet?

    I have a 1-CPU LSWS @ $32.00 per month so will probably upgrade to the 2-CPU as this would give better performance than 1-cpu and LSCache right? (especially as it is only $4 more per month). But I would like to see real-test results on the performance gains for the additional $12 per month to get this.

    I guess you will be emailing all subscribers of LSWS once the plugin is available.

    • Michael Alegre says:

      Hey Delboy,

      As of this moment we have not done any in-house testing of the new plugin so I can’t give any specific comments on it’s performance.

      The plugin itself will cache dynamic pages as static like other popular WordPress plugins but will also have the advantage of reduced overhead and better ease-of-use by being specifically designed for LSWS’s built-in LSCache. We are confident that the plugin will perform better than other currently available caching solutions and should have some benchmarks showing just how much posted to our blog as we get closer to release early next year.

      We will announce the release through our usual channels – Blog, Forum, Edge Users Google Group, and Twitter.

      As for your license question, it can depend on your current setup and how you are using LSWS. In general caching is the best performance upgrade you can implement, but a good way to test if the upgrade to a 2-CPU is worth it for you is to request a trial license and test that way (all trial licenses are 2-CPU).

      Hope this information was helpful to you!

  3. Delboy says:

    Will your plugin be a paid one? and when will it be available please?

    I am running LiteSpeed 5 and host around 30 WordPress websites on my dedicated server, so this is very exciting news that there will be a dedicated cache plugin for WordPress with LS that will increase load time even more 🙂

    I have tried the 2 cache plugins you have mentioned but settled for ZenCache in the end as this outperformed both of these plugins on 5 websites that I tested side by side…results from GT Metrix showed ZenCache as the fastest loading on all 5!

    • Michael Alegre says:

      Hi Delboy, Glad to hear your excited!

      Our WordPress Cache plugin should be available at the beginning of next year. The plugin itself will be free but will require a LiteSpeed Web Server License w/ LSCache (included in 2-CPU+ Licenses).

  4. Bruce says:

    Just curious – why didn’t you use version 5.x of LiteSpeed in the tests?
    Wouldn’t version 5 have done even better?

    • Michael Alegre says:

      We chose not to use LSWS v5 for this benchmark as it is still new and under active development for new features etc. We will begin using v5 in benchmarks once a performance/optimization focused release is ready.

      As of right now, there should be no big difference between v4 and v5 performance.

  5. Monarobase says:

    Any chance of making your WordPress plugin compatible with WooCommerce using ESI ? WordPress + WooCommerce is currently the most used e-commerce solution.

  6. Bigwas says:

    As a user, Using WP Super Cache using PHP caching is super fast on my shared hosting.

  7. Hey says:

    Hey,

    I would love to see a comparison of WP Rocket (wp-rocket.me) as an alternative to WP Super Cache.
    (No affiliation with the company other than a customer).

    • Michael Alegre says:

      Thanks for the recommendation. The purpose of this benchmark was to show the huge performance difference between WordPress with/without caching, not the performance of any cache plugin in particular.

      On the other hand, we are currently considering running some comparisons between different caching solutions on WordPress once the LiteSpeed Cache plugin for WordPress is at a more developed stage, so keep an eye out for that!

  8. Stevo says:

    Do you develop “wordpress plugin” or “litespeed wordpress plugin/module”?
    If you develop litespeed module, don`t waste your time, it can not be faster then rewrite cache.
    Check why here: https://groups.google.com/forum/#!topic/openlitespeed-development/Lr38x8WZtIA

    Comment from openlitespeed post:

    I just enabled cache for every php file and of course response had “x-litespeedcache: public” header.

    I think osl cache can never be faster then wordpress w3tc simple becouse:

    1. No matter how complex are w3tc settings for page cache, every rule is generated in rewrite, so web server just parse the rewrite and if there is file, simple just give that file as result.
    2. Ols cache do the same + for evey request it checks if cache is expired, stale, first checks for private then for public cache etc….

    But to be honest, OLS cache is made to be generic caching module.

Leave a Reply