Greetings, Wordpress Wizard

Welcome to the first unified way to benchmark your hosting using simple Wordpress plugin.
A simple way to find out if your server is fast or needs an upgrade.

Tips for improving Wordpress performance

Updated: 26.february.2024

These suggestions are mostly based on my own experience as system administrator with 20+ years of experience. To apply them you in most cases should be administrator or owner of the server. If you run your Wordpress site on shared hosting - you might want to ask your hosting provider to look through them. I open to answer questions and might update these tips in the future.


10.july.2023: I have benchmarked several servers, mostly targeting CPU performance - sharing small overview and thoughts here in my blog.


Webserver & PHP tune

  • Use as latest PHP version as possible - there is steady tendency, that newer major PHP versions will execute same code more efficiently and faster. Significant improvement in several functions have been noticed in PHP8.3 and independant research by kinsta.com confirms improvement with PHP8.3.
  • Make sure, that opcache PHP extension is installed and active
  • If possible - switch to PHP-FPM, use either static or dynamic PHP-FPM pm-manager.
  • Make sure your webserver support HTTP/2 and offers either deflate, gzip or brotli compression. There are various online tools, which can check this for you, search for webpage compression test.
  • If you are using Apache - choose either mpm_event or mpm_worker.

CPU performance

You should understand, that PHP is not multi-core processes, that means, that one PHP request utilize one CPU core. That means that speed of processing of one request does not depend on number of CPU cores, but more on single core performance and clock speed. My tests on different CPUs (both AMD and Intel) show, that clock speed makes more difference - therefore I suggest choosing CPU with higher clock speed. Quite often expnsive server CPUs with 32-64 CPU cores are clocked with lower MHz, than more desktop-grade CPUs.

CPU performance will affect Wordpress speeed most of all, therefore always try to look for the fastest CPU with highers frequency. If you are interested, I can offer temporary hosting on a fast server with fast CPU, so you can see the difference yourself.

Filesystem tuning

  • Choose SSD hosting - this has become a standard - hardly any hosting company offers hosting on old spinning disks
  • Add noatime tag to filesystem mounting options in /etc/fstab - this will instruct Linux not to write time of the last access-time of the file.
  • Avoid using SWAP as much as possible. Add the following parameter to /etc/sysctl.conf to instruct kernel to get into SWAP as late as possible:
    vm.swappiness=0
  • Instruct Linux to write data onto disk in larger bulks and with a bit of delay - while this adds certain risk, it can greatly improve overall writing performance, especially for small files. Add similar values to /etc/systctl.conf:
    vm.dirty_ratio = 8
    vm.dirty_background_ratio = 4

MySQL database performance

  • My suggest is to use MariaDB 10.3 or MariaDB 10.5, both with enabled query cache.
  • Some MySQL settings can do a lot difference, I list most critical ones:
    						
    # CHANGED on 29.june.2023
    innodb_flush_log_at_trx_commit=0
    
    innodb_file_per_table=1
    innodb_thread_concurrency=0
    innodb_buffer_pool_size=4G
    innodb_buffer_pool_instances=8
    innodb_log_file_size=512M # updated 29.june.2023, increased
    
    # only if you are using MariaDB
    # query cache is not available in MySQL8+
    query_cache_type=1
    query_cache_limit=128K
    query_cache_size=64M
    query_cache_min_res_unit=512
    
    performance_schema=0
    
    sql-mode="NO_ENGINE_SUBSTITUTION"
    
    # added on 29.Oct.2022
    # especially for MySQL 8.0
    innodb_redo_log_capacity=512M # ONLY if you have MySQL 8.0.30+
    innodb_log_buffer_size=512M
    disable_log_bin
    
    
    # REMOVED FROM SUGGESTION, 29.june.2023
    # innodb_log_write_ahead_size=128K 
    
    
    # ADDED on 29.june.2023
    innodb_io_capacity = 2000
    innodb_io_capacity_max = 5000
    innodb_checksum_algorithm = crc32
    innodb_log_compressed_pages=OFF
    innodb_change_buffering=all
    
  • Do not set innodb_buffer_pool_size or innodb_log_file_size too big. Also do not set query_cache_size higher than 128M or make proper tests, making sure it will not degrade performance.

Object cache & opcache

  • Make sure you have opcache PHP extension installed and enabled.
  • If you have dedicated server for your Wordpress - install & use Redis for object cache.

WordPress optimization

I strongly suggest reading and going through amazing WP expert blog - Tom explains a lot about Wordpress performance from plugin, theme and caching optimization perspective. Very well structured information and great tips. Well done Tom!


If you struggle with configuring your server, I can help. As well as I am very open for suggestions and comments on this topic - please don't hesitate to contact me.

Total tests

83268

Global stats

2024
Average score

7.74

PHP 5.6
0.01%
PHP 7.0
0.02%
PHP 7.1
0.02%
PHP 7.2
0.10%
PHP 7.3
0.58%
PHP 7.4
13.19%
PHP 8.0
7.88%
PHP 8.1
30.47%
PHP 8.2
29.18%
PHP 8.3
18.55%

2023
Average score

7.38

PHP 5.4
0.01%
PHP 5.6
0.03%
PHP 7.0
0.06%
PHP 7.1
0.05%
PHP 7.2
0.22%
PHP 7.3
0.66%
PHP 7.4
22.83%
PHP 8.0
17.71%
PHP 8.1
32.86%
PHP 8.2
24.24%
PHP 8.3
1.32%

2022
Average score

7.4

PHP 5.4
0.00%
PHP 5.6
0.14%
PHP 7.0
0.18%
PHP 7.1
0.11%
PHP 7.2
0.60%
PHP 7.3
2.45%
PHP 7.4
48.84%
PHP 8.0
20.48%
PHP 8.1
26.84%
PHP 8.2
0.36%

2021
Average score

8.02

PHP 5.4
0.01%
PHP 5.6
0.39%
PHP 7.0
0.30%
PHP 7.1
0.11%
PHP 7.2
2.01%
PHP 7.3
9.83%
PHP 7.4
75.31%
PHP 8.0
11.21%
PHP 8.1
0.83%

2020
Average score

7.82

PHP 5.4
0.03%
PHP 5.6
1.19%
PHP 7.0
2.53%
PHP 7.1
3.06%
PHP 7.2
11.76%
PHP 7.3
33.45%
PHP 7.4
47.27%
PHP 8.0
0.71%

2019
Average score

7.84

PHP 5.6
0.66%
PHP 7.0
5.96%
PHP 7.1
4.64%
PHP 7.2
29.14%
PHP 7.3
53.64%
PHP 7.4
5.96%

Public wall of benchmarked sites

Developed by Anton Aleksandrov - hosting.guru - 2024