Over the last weeks, I’ve tried to improve the performance of my blog. The side was very slow and the page load times varied between 5 and 10 seconds. Much too long! I’ve reduced time consuming plugins, checked the size of pictures, checked CSS and HTML for misconfiguration/ slow clode and tuned the database. The page load times have not really improved.
Yesterday, I checked the httpd.conf on my webserver and found a little typo (accidentally commented line). After a restart of the Apache webserver, the page load times have dramatically improved (down to 2 – 3 seconds). What had happened?
HTTP keep-alive, sometimes also called “HTTP persistent connection”, was designed to transfer multiple HTTP requests and responses over a single TCP connection. This is much better as opening a new connection for every single request/ response pair. The benefits of HTTP keep-alive are:
- lower CPU usage
- lower memory usage
- reduced latency due to reduced requests/ handshaking
These benefits are even more important, if you use HTTPS connections (and vcloudnine.de is HTTPS-only…), because each new HTTP connection needs much more CPU time and round-trips compared to an unsecure HTTP connection. This little picture clarifies the differences.
If you’re using Apache, you can enable HTTP keep-alive with a single line in the httpd.conf.
- Fan health sensors report false alarms on HPE Gen10 Servers with ESXi 6.7 - May 11, 2020
- Missing Microsoft Teams calendar tab with on-premise Exchange - April 12, 2020
- Connecting to Exchange Online with PowerShell - February 26, 2020