A massive 260% performance boost for uncached content

Posted by: 
Dejan Grofelnik Pelzel
Dejan Grofelnik Pelzel
November 8th, 2018

During the past week, we have been silently testing and deploying a big new update targeting the performance of uncached content on BunnyCDN. Things went well, really well in fact. We've seen performance improvements in the range of 30% all the way up to 260% or more as shown in the tests below. With that in mind, I am very excited to announce that the update is now live worldwide and enabled for all of our users. BunnyCDN is hopping faster than ever!

This is especially great news for websites that have a lower cache hit rate or publish lots of new content often and want to make sure to get the best performance possible. It also significantly boosts performance for users with full website caching or serving dynamic content.

260% performance boost?! What did you do?

Origin Keep-Alive

Prior to the update, each uncached request going through BunnyCDN would first set up a connection between the CDN node and your origin server before transferring the file. This occurred for every request that travelled uncached through BunnnyCDN and meant that there was actually a considerable overhead caused by the time needed to establish and "warm up" a connection for each request.

This can be a big problem with CDNs due to how most caching software works. In some cases, it can even hurt the performance of a website if a lot of uncached data is requested. With BunnyCDN, this is no longer the case. We've implemented a custom Keep-Alive system that works around the limitations. It means that the BunnyCDN servers now keep an open connection with your origin server and reuse it to transfer multiple requests over it without the big overhead.

Lazy DNS updates

The second update we did was that we implemented a custom DNS resolver solution that no longer blocks active requests when revalidating your origin DNS record. Prior to the update, when the DNS TTL of your origin URL expired, our system would block all requests back to the origin until the DNS query was finished. This caused an unnecessary delay and could potentially result in a loss of connectivity with your origin server if anything went wrong.

The new system keeps the DNS records in cache and when the TTL expires, silently starts to revalidate the record in the background. This way, you will never see a DNS performance hit and will always enjoy quick connections back to your origin. When something goes wrong, our servers will just retry the request and update the new IP as needed.

The results in numbers

Enough talking about the changes and let's get to the actual results. We ran different tests around the world with origins and test servers in different locations. Below are the average results of what performance changes you can expect.

~30% Quicker Uncached Website Load Time

BunnyCDN Uncached Website Performance Boost Graphics

~260% Faster Uncached Cache-Slice Download

BunnyCDN Uncached Throughput Performance Boost Graphics

During our tests, depending on the distance between the origin and the server we saw a throughput increase of up to 260% and more, which is huge and we are really excited about it. The new update also reduces buffering between video seek times for uncached video files and just makes everything run much smoother.

~50% Lower Uncached File Latency

The last test we focused on was testing a single file being fetched back from the origin in Germany to Seattle. This situation happens for example in the case of a single cached item such as a CSS file expiring from cache. Compared to testing the whole website, this test proved to have more overhead and offered an even bigger performance boost of up to 50%, especially when the origin DNS record needed to be fetched.

BunnyCDN Single File Uncached Performance Boost Graphics

Hopping faster and faster!

Uncached requests can cause a big performance issue when not handled optimally by a CDN. We are incredibly excited about the update and we believe it is one of the biggest performance updates we have done to BunnyCDN during 2018, but we aren't stopping there. We are always working hard on new ways to speed things up and have some great new features planned to release in 2019, so definitely stay tuned! IPv6 is almost back as well :)