I am very keen on pushing the limits of performance, especially as a way of teaching myself ways to be able to improve application performance (albeit this is a static HTML page load with some JavaScript). My aim was to be able to load pages from https://www.willhallonline.co.uk and https://www.motnearme.co.uk in less that a second (on a reasonable connection), globally.
I rebuilt this site between 1 year and 4 months ago using Hugo. Honestly, making the site in Hugo was pretty nice and straighforward, the challenge came with migrating content and re-writing into markdown and also preserving aliases.
In terms of the site, you can have a look around as required. Overall, the site is around 1mb in size (depending on the JavaScript and stuff that Google is adding). My previous site was running Drupal 7 and I managed to get that down to about 1.5 seconds loading globally. Not that the first time byte was any slower (and you can see that on Mot Near Me, my other fun site for playing with data/geolocation).
So overall here are the stacks:
Will Hall Online | Mot Near Me | |
---|---|---|
URL | https://www.willhallonline.co.uk | https://www.motnearme.co.uk |
Platform | Hugo | Drupal 7 |
Hosting | GitLab Pages | |
Web Server | Nginx (GitLab Pages) | Nginx |
Server Side | None | PHP-FPM (PHP 7.2) |
Database | None | MariaDB (10) |
Base performance is relative to the hosting location as there is no CDN involved at this point. Honestly, the performance of both sites is pretty ok. Mot Near Me is smaller than Will Hall Online (mainly due to lack of pictures and funny icons) but both are less that 1MB.
Performance are averaged across 3 runs on WebPageTest.org using Cable (5/1 Mbps 28ms RTT) connection and EC2 inside Chrome running from Virginia (US), London (UK), Frankfurt (DE), Mumbai (IN), Seoul (KO) and Sydnet (AU).
Location | Will Hall Online | MOT Near Me |
---|---|---|
EC2, Virginia (US) | 1.2 | 1.5 |
EC2, London (UK) | 1.4 | 1.6 |
EC2, Frankfurt (DE) | 1.3 | 1.6 |
EC2, Mumbai, (IN) | 3.4 | 3.2 |
EC2, Seoul, (KO) | 2.8 | 2.7 |
EC2, Sydney, (AU) | 3.0 | 3.1 |
Inside CloudFlare I enabled almost all of the free options for speeding up performance including:
Location | Will Hall Online | MOT Near Me |
---|---|---|
EC2, Virginia (US) | 0.8 | 0.7 |
EC2, London (UK) | 0.9 | 0.8 |
EC2, Frankfurt (DE) | 0.9 | 0.7 |
EC2, Mumbai, (IN) | 2.0 | 1.6 |
EC2, Seoul, (KO) | 1.5 | 1.3 |
EC2, Sydney, (AU) | 1.8 | 1.7 |
The interesting thing to notice from this is that India is still significantly worse than either Seoul or Sydney. Not sure what that suggests, possibly the latency on the line to India is more significant or there are less CDN endpoints near to India?
Additionally, I should add that despite Will Hall Online being a static site, it is running from GitLab.com as a GitLab Pages site and appears to have a significant penalty with regards to time to first byte, which I would expect is why it is across the board slower than a site that is running PHP (although it is quite heavily cached).
Location | Will Hall Online | MOT Near Me |
---|---|---|
EC2, Virginia (US) | 0.4 (33.33%) | 0.8 (46.67%) |
EC2, London (UK) | 0.5 (35.71%) | 0.8 (50.00%) |
EC2, Frankfurt (DE) | 0.4 (30.77%) | 0.9 (56.25%) |
EC2, Mumbai, (IN) | 1.4 (41.18%) | 1.6 (50.00%) |
EC2, Seoul, (KO) | 1.3 (46.43%) | 1.4 (51.85%) |
EC2, Sydney, (AU) | 1.2 (40.00%) | 1.4 (45.16%) |
Average | 0.87 (37.90%) | 1.15 (49.99%) |
For my own interests I wanted to generate some kind of data driven decisions on what kind of performance improvements cloudflare will give me. Honestly the applications were not particularly poor-performant beforehand, however, I have made it possible for most of US and Europe to get sub-1 second connections (with the rest of the work mainly being sub 2 second).
I am 100% sure that if I moved the host of Will Hall Online to somewhere with a faster TTFB (time to first byte) then that would improve performance overall probably by another 10%. However, the figures at the end suggest that employing CloudFlare across my sites have given globally between a 37% and 50% improvement in page load, which I think is quite considerable.
Not only does this emphasise the need for using CDN but it also makes us remember that latency is a very important factor in running applications over the Internet (especially whilst we are tied to the speed of light for data transfer). I have to stress I am not using any custom features of CloudFlare or running anything but the basic Free plan. All in all, a very interesting experiment.
Connect on LinkedIn. Follow me on Twitter. Grab the RSS Feed