>>> 0.0063*24*30 4.536
Quick note about Hetzner cloud pricing
I use a Hetzner VPS “cloud” server for hosting this blog and recently discovered a small detail in its pricing that can save you a few euros under some circumstances. I want to clarify this information is not exactly hidden. It’s clearly stated in their billing FAQ but, still, some absent-minded people like myself may not be aware of it until you see the bill.
Price per hour and monthly cap
Cloud servers in Hetzner are prominently announced with a very visible price per month and also a price per hour displayed in a smaller font next to it. For example, take a look at the current price for a CX11 instance, the type that hosts this blog, without an IPv4 address applied. It’s the cheapest one they have (click on the image for the full size).
Keen eyes (not mine) will notice the price per hour is not merely a clarification of the monthly price to help you calculate the cost of a server you use for less than a month. The price per hour is higher than the price per month in a typical 30-days month:
This means that the price per month is actually a limit in the total price that applies if, and only if, you use the server for the whole month. It works like a loyalty discount.
When does this matter?
In many circumstances. For example, my blog server runs Fedora. Because I use it in all my systems and I’m lazy and I don’t want to use or learn anything else to host a blog. Anyway, that means roughly every 6 months there’s a new Fedora release and I have to upgrade the server. I could upgrade it in place but I like reproducibility, so I have a semi-automated script/procedure that installs what I need on a brand new server and copies data from the old one. So, normally, I upgrade the OS by creating a new server, going through that process, verifying everything works and shutting down the old instance. This takes around 15 minutes.
What happens if I switch servers in the middle of a given month? That month, being optimistic and supposing I can switch instantly with no overlap in hours, the old server will not be used for the whole month. It will be used for half of it, and the new one will be used for the other half, but not a full month either. Neither of them gets the discounted monthly price and I have to pay, in total, a full month at the per-hour rate. So instead of paying €3.98 I pay €4.54. It’s just a few cents, but a 14% increase over the normal price. In the most expensive cloud instance, the difference in price is over €10.
Applying a different strategy
The best way to proceed in these cases, I think, is to switch servers on the last day of the month, this way:
-
Spin up the new server that day as late as possible in the evening.
-
Migrate data from the old server to the new one.
-
Wait for the next day in the morning and shut down the old server.
The old server will be used for a whole month plus a few hours of the following one. The new server will be used for the whole following month, plus a few hours of the previous one.
Typically, this means you would pay the normal monthly price cap for both months, plus no more than 12 hours at the per-hour rate in excess during the overlapping period.
>>> 0.0063*12 0.0756
Only 8 cents above the normal monthly price, or a 2% increase (at most) over a normal month if you want to put it that way. This also applies to IPv4 addresses, which have a per-hour rate and a monthly cap just like servers. For the curious, adding both costs I pay €4.59 on a normal month for the server as of the time I’m writing this.