Kleki Blog

Migration to bunny.net

general

I migrated Kleki's hosting away from Netlify to bunny.net, a European provider primarily known for their CDNs.

I made this move because last year Netlify introduced a credit-based pricing model which would increase Kleki's hosting cost by around 1070% - from $20 to $234 (it was more expensive at the time of their announcement). This was calculated using their own calculator with Kleki's January traffic as inputs:

Resource Usage Credits
Compute 0.3 GB-Hrs 5
Prod deploys 20 300
Bandwidth 506 GB 5,060
Requests 99M 29,700
Total 35,065

3,000 credits are included in the Pro plan, leaving 32,065 extra credits needed. Extra credits cost $10 per 1,500.

32,065 ÷ 1,500 × $10 = $214 in extra credits

$20 (Pro plan) + $214 = $234/month

Meanwhile, hosting Kleki on Bunny slashes my costs in half to around $10. As a legacy customer I wasn't on Netlify's credit-based pricing yet, but it's fair to assume they will get rid of the old pricing eventually.

What is the new setup? Via GitHub Actions, I build an nginx Docker image for each app, push them to a private GitHub package repository, and then let Bunny deploy them via their "Magic Containers" which are automatically scaled containers that can run in many regions globally. In front of those sits a CDN which heavily caches Kleki's static content. I get a 99.55% cache hit rate, meaning barely any requests reach the actual containers. This was less intuitive to set up, but now that it's running I don't need to do much maintenance. I also considered a VPS setup where I would have been more worried about maintenance and scaling.

bandwidth stats

I am glad I made the move. On Netlify I worried that I would reach my traffic volume quota at which point things start to get more expensive, even on the legacy pricing model. Now this really doesn't matter. If Kleki's audience grows an order of magnitude it's still affordable. If there is an astronomical increase in traffic, Bunny offers tools to deal with that. You can pick their cheaper CDN tier with half the cost. You can set a bandwidth limit. If your balance hits zero they just take your site offline. It doesn't stay online and potentially accrue a huge bill like on Netlify or similar providers.

There are more advantages. Anyway, with this new breathing room I think I will change how the app loads. Maybe I will get rid of lazy loading, and load all assets at page load so it doesn't matter if you lose your internet connection during drawing.

Donate to support Kleki's development!

-bitbof