22nd August 2022
Analysis of Website Performance
1. Problem statement. I had written on website performance and measurement here:
- Speed-Tests with Pingdom.com
- Bandwith Diet for This Blog
- Accelerating Page Load Times by Reducing Requests
- Accelerating Page Load Times by Reducing Requests, Part #2
The overall lessons were:
- Measure your website performance
- Reduce image size by using modern file formats, e.g., WebP
- Reduce number of requests
I now measured the website nukeKlaus.net, which I knew for some years and always was and is still very slow. This site is about nuclear energy production from the standpoint of an nuclear energy engineer. It gives a wealth of information on technology, country usage, nuclear waste management, financing of nuclear power plants, and economic opinion. It is written by Dr.-Ing. Klaus Humpich.
2. Measurements. DNS lookup of nukeklaus.net shows no problems.
$ time nslookup www.nukeklaus.net Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: Name: www.nukeklaus.net Address: 184.108.40.206 real 0.05s user 0.00s sys 0 swapped 0 total space 0
Measuring with tools.pingdom.com for Frankfurt (Germany) for "http://www.nukeklaus.net/2020/09/25/beginn-einer-atemberaubenden-serie/" gives:
Obviously, the performance is terrible. Analyzing what request are made, one finds:
Below diagrams clearly shows that most of the time is wasted with waiting.
Above image was produced by uploading the har.json from pingdom.com to har-viewer.
Below is the partial list of downloaded resources:
Just downloading the HTML content lasts more than 11s:
$ time curl http://www.nukeklaus.net/2020/09/25/beginn-einer-atemberaubenden-serie/ -o /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 56891 0 56891 0 0 4897 0 --:--:-- 0:00:11 --:--:-- 16866 real 11.63s user 0.00s sys 0 swapped 0 total space 0
While just downloading a single static file, an image in this case, is just fine:
$ time curl http://www.nukeklaus.net/wp-content/uploads/2018/04/cropped-KeepMum-Kopie-1-768x305.png -o /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 373k 100 373k 0 0 2233k 0 --:--:-- --:--:-- --:--:-- 2247k real 0.17s user 0.01s sys 0 swapped 0 total space 0
So the performance characteristics indicates that WordPress and/or MySQL are to blame.
3. Server setup. nukeklaus.net has the following setup.
- Hosted by myloc.de
- Uses WordPress.org 6.0.1. That version is current.
- It uses nginx 1.16.1, which is two years old and not recent. Recent version is 1.23.1.
- Uses PHP 7.3.9, which is three years old and does no longer get security fixes. Recent version is 8.1.9.
All this general setup does in no way explain the terrible performance.
4. Remedy. One possible solution for tuning the performance would be to use a static site generator. One could use Simplified Saaze. Another route would be to try to use a Varnish HTTP Cache. Also, the 26 HTTP requests indicate that a "request diet" would also be highly beneficial.