Regionalised API performance testing
We are a bit obsessed with performance at Learnosity and are constantly looking at both big and little changes that we can make in order to improve the performance of our systems for our clients.
For the impatient – the key results of loading our Questions API from inside Australia are:
- Reduced load time by 57% cached and 65% without a primed cache.
- The Onload event is fired at about ½ a second, compared to at around 1 second when using it from the US region
As we have users on every continent some of the speed issues come down to the physical limits of the speed of light. We already use lots of performance optimisations including reducing content size through minification and compression, caching content as much as we can, and use of CDN’s to bring the cacheable content physically closer to our end users.
The next evolution in our drive for speed involves bringing our servers even closer to our users and so we have brought in regionalised API’s for the AU region in addition to our primary US-East location.
In the future we will bring in additional regional zones but for our initial testing Australia is really useful as it’s physical distance from the US magnifies the issues with latency.
The data was captured from the Chrome Developer Tools using a test page that loaded the Questions API from Australia or the US. We repeated each test 5 times and averaged the sampled data.
|DomContent Loaded (ms)||Onload firing (ms)||Load Completed (ms)|
|US region (cached)||569||847||2138|
|AU Region (cached)||407||445||1222|
The findings from the table and graph show significant improvements across the board, with the DomContentLoaded and Onload events firing at approximately ½ a second compared to between ~0.9 and 1.5 seconds for cached and uncached respectively.
The time for the entire page load to complete has been reduced by between 57% and 65% for users in the AU region, which is a huge performance gain and significantly more than we were expecting.