Hacker News new | past | comments | ask | show | jobs | submit login
Set Up a $4/Mo Hetzner VM to Skip the Serverless Tax (shipixen.com)
89 points by tosh 3 months ago | hide | past | favorite | 86 comments



The title is clickbait or maybe simply misguided in my opinion. A cheap VM and Serverless services are very different things and not directly comparable.

But I do sometimes get the impression that the simple approaches are discarded too easily today. You can rent a lot of hardware pretty cheap from Hetzner and the raw power you get is much higher than what you get with cloud services for the same amount of money. Of course the cloud also provides more stuff, but you really pay a hefty price for some of the things you get there (cough traffic).

The difference gets even larger when you look at the Hetzner root servers, that's a lot of CPU, RAM and storage for little money. And renting actual servers does seem to be overlooked a bit at times, often the comparison is between the cloud and actually buying servers and doing everything yourself.


It's true the title is clickbait and VMs and serverless are completely different beasts.

However, there is something right in this title: when you take into account how serverless was originally marketed ("you save costs as you run things only when you need so you save on these expensive ec2s running 24/7") and the reality (performance issues, cold boot, arbitrary timeout limit, high cost for longer-running processes) it may turn out that cheap VMs might work much better in scenarios where serverless was initially considered.


Combine that with OpenFAAS for the complete package.


Who are comparable providers in your opinion? Hetzner has KYC and needs ID for you to use their services, I’d rather go with a service that didn’t. Any recommendations?


There some hetzner resellers which accept crypto coins instead

OVH(and subsidiaries like server 4 you,kimsufi) is the pricing a bit higher but comparable (in some regions) But last time I used ovh Hetzner also didn't require Id verification, maybe they changed since then

Ionos also similarly priced didn't need Id last time I used them


OVH wants ID as well in some cases. If you're in the US you aren't getting an OVH overseas anymore to my knowledge. Although, you can get 2gbps unmetered on your servers which is awesome.

I've just been being lazy and buying a domain from namecheap and getting the VPS Pulsar (6GB RAM, 4cores), 250mbps up/down for when I do a project. one server does fine for multiple projects usually.

OVH is still grand-daddy IMO.


Confirming this is the case. OVH closed all my non-US accounts approximately 1 year ago.


> There some hetzner resellers which accept crypto coins instead

Who? I would assume hetzner would close those accounts pretty quickly.

What is their markup?


I’m so disillusioned with cloud/serverless/Kubernetes these days. If I were building a startup I’d just build a monolithic service, plonk it on a Hetzner VM, boom done. You can start making money.

So many startups are bleeding cash because they’ve been convinced by AWS and others they need auto scaling and self healing from day one. Just build the thing, get it running, make it good later.


Honestly, same. I'm building a small BE for a small startup with a friend of mine, and while sometimes I have these urges that I should migrate everything to K8S / Docker Swarm, so far the setup with three small VMs of API server machine + ingress machine + auth machine with simple SSH deploy through GitHub Actions (that can always be performed manually, if needed) works fine. Is it fancy? No. Can I understand everything to the last details what happens during deploy and debug it? Oh yes.

Focusing on fancy infra now will just take a lot of time for little to no benefit.


It sounds a bit like a grift these days; investors want you to invest millions in infinite scaling ops 'because good' so you don't get the big money if you don't so you do, wether you may ever need it or not.

Almost every startup can run their entire lifetime on a $4 vps and have the same outcome if it wasn't for the required (...) vc moneys.


How does Hetzner compare to Digitalocean?

I always hear great things about Hetzner. I don't know if those comments are just patriotic Europeans or if Hetzner is really that much better than the alternatives.


Hetzner is dirt cheap, and especially known for dirt cheap bandwidth.

They had a bit of a reputation for unreliability but that was decades ago, I expect them to have improved and it's definitely more than good enough for a hobby project.

My main concern with them would be the abuse policies - unless that changed in the past couple of years, they have a "shoot first ask questions later" approach (shutting down or firewalling your server, then asking you to explain/fix the issue before maybe turning it back on - e.g. if their automated systems detect what they think to be a port scan).

Pricing:

$6 on DigitalOcean gets you 1 GB RAM, 1 vCPU, 1 TB traffic, 25 GB SSD. Additional traffic is $10/TB.

€4.51 ($5) on Hetzner gets you 4 GB RAM, 2 vCPU, 20 TB traffic, 40 GB SSD. Additional traffic is likely around €1/TB.

$48 on DigitalOcean gets you a VM with 8 GB RAM, 4 vCPUs, 5 TB traffic, 160 GB SSD.

$48 (€43) on Hetzner gets you a physical machine with e.g. (the specs are a bit random since you're picking from a list of customized systems) an Intel XEON E-2176G (6 cores/12 threads), 64 GB of ECC RAM, 2 x 960 GB SSD, and a Gigabit link with "unlimited" traffic (there are reports https://lowendtalk.com/discussion/180504/hetzner-traffic-use... that they don't like it if you actually max out the line rate all the time, but you should consider the 20 TB/month they offer by default the minimum that they will have absolutely no issue with).


If you want even cheaper then go with netcup.{com,eu} - astounding what you get for the $, and they are actually quite reliable and stable.


Been using netcup for 2 months now, their dashboard/webapp is ultra garbage, but I have no problems around hardware I am getting and boy, it's worth the price.


They're great if you need raw processing power but they have a very backwards, German view of the internet where even a port scan is considered abuse. It's very easy to get your machine nullrouted or account closed.

I use them a lot for backend data processing but anything public facing I host at AWS or Digital Ocean who have a more reasonable approach to the internet.


I've just switched from DigitalOcean to Hetzner purely for cost. I'm getting more resources for less money. Features seem pretty comparable to me but I don't need anything more than a standard VPS. The only thing I've found weird is SELinux being set to permissive by default.

I'm not sure why anyone would be patriotic about a private company.


> SELinux being set to permissive by default.

My bet is to reduce support calls. "Why can't I do X and Y on this server?"


I am a hetzner customer for around 5 years, and DO customer for 12. Hetzner is always on point. Botched your vm? they mount a live cd and let you rescue the system. Got provisioned hardware? they provide hardware reset services in case software reset doesn't work. They continuously check if your ip is blacklisted and warn you. They check for vulnerable ports and EU security mandates. UI and prices are competitive. Overall great experience.


I’ve never used DO, but I’m a happy Hetzner customer of over a decade. The cloud offering is solid, and I’ve had several VMs running for years.

I had one project which was part AWS, part Hetzner, for cost reasons. Both driven from terraform.

If you can do it with simple VMs, I’d go for Hetzner. Of late they’ve added more features like private networks.

The original offering is real servers, and the “server bidding” feature is brilliant for getting a bargain.


I have both DO and Hetzner VMs and I find them comparable, with Hetzner being a bit cheaper. If I look at the logs and fail2ban, it looks like DO does a bit more abusive traffic filtering, but that is basically the only difference.

However, the DO docs are on a different level and high quality. But those are also accessible if you are not a customer.


> I don't know if those comments are just patriotic Europeans or...

This is nitpicky, but just want to mention that Europe is a continent made up of 44 diverse and distinct nations, and Hetzner originates from one of them.

Patriotism doesn't really work in that situation (nor in the context of a private company).


I’m not sure if there’s another word besides “patriotism”, but there certainly is a sense of continental pride amongst many (especially western) Europeans that mimics what American’s have for their nation (and not, e.g., their state [Texans aside])


Lets be real, there's no other country that has the same amount of patriotism than the US (for better or worse). You have kids in school "pledge allegiance" to a flag each morning. The only other countries comparable on that level are China, Russia, and North Korea - and they're not exactly doing it out of free will.

A more apt comparison would be how Americans feel towards their president. Most like them, others dislike them, but overall they're proud to have them. They're there in tough times and easy to blame when something doesn't go their way.


DO is crazy expensive compared to all big EU hosters; we run servers at ovh and hetzner for decades; no issues, but, and this does make a difference even though people keep saying it does not on reddit, I speak german and french and I call them when I need something.


I've been using their services for over a decade (first physical servers, now their cloud) and have little to complain. It just works, and if something breaks, they help you real fast.


I personally like the UI much better (less bloat + CTAs), and the prices seem cheaper.


If you have only heard great things, you've not been paying very much attention. Hetzner is known for deleting nodes and accounts without warning or explanation if your CPU usage stays persistently high. They even had the audacity to send a bill thereafter.


We're using tons of Hetzner nodes that are under constant heavy load (~100% CPU usage for ~12 hrs/day), never had problems. I know this is anecdotal, just logging it here.


I’ve been on the “very negative experience” side with Hetzner. It’s great when it works but terrible when they decide to null route your account and take a week to respond to support inquiry.


We use it professionally. Just to give an anecdote to counter an anecdote.


> We use it professionally.

That doesn't really say anything in the parent context of persistent 100% CPU usage.


So…. What’s your anecdote?

Did you have a particularly positive experience?


I often hear people complain about Hetzner for two reasons: (1) their attitude towards crypto, (2) ID verification.


Going with a title like “How to set up Hello World on a Hetzner VM” would be less misleading.


I would use Hetzner more but most of my user base is in the USA, and there is a lot of added latency to having your servers in Europe. I sort of think of Hetzner like a Costco for servers - does anyone know the closest equivalent in the USA?

Update: Hetzer does have USA servers, but apparently not dedicated bare metal servers in USA (only shared/VM).


Hetzner has datacenters in US these days: https://www.hetzner.com/unternehmen/rechenzentrum/

(haven’t tried them though)


Note they currently only offer AMD VMs in the US though, they don't have Intel VMs, Ampere VMs, or any dedicated bare-metal boxes there.


I use it, `time=39.741 ms` when I `ping` my Oregon server from LA


Hetzner has servers available in Ashburn, VA and Hillsboro, OR.


Important to add: virtual servers. They don't offer physical servers in the US, as far as I remember they're not running their own data centers.


I didn't notice but the dedicated machines are indeed "vCPU". But isn't that how all VPS providers do it? How else would they manage/sandbox the machines?


The point is that their dedicated servers in EU are not VPS:es. They are dedicated servers, not virtual private servers. This usually means better performance (at the same pricepoint but dedicated have a higher starting point) among some other pros.

A VPS with dedicated vCPUs is not the same as a dedicated server.


Bare metal machines only need a minimal hypervisor, no need to sandbox if there are no other users.


Is Hetzner the same as OVH? OVH has data centers in the same cities.


No. Hetzner is German, OVH is French.


Different companies, those are just both places with high concentrations of data centers; Ashburn specifically has been a data center hub since the AOL days.


Nope different companies But they may colocated in the same date centers Hetzner USA is located inside NTT Global Data Centers Americas, Inc. QTS Investment Properties Hillsboro, LLC


Hetzner sell VMs located in the East Coast US as well: https://www.hetzner.com/cloud/


West coast too, FYI.


There's a million us hosts, go with any of them, vms are a commodity product.


What if I'm nervous about my SQL db? I pay 12$ onwards to RDS so I can do one click backups and restores to any point in time. With a VPS, I have to make a script to cron to generate backups and test that the VPS backup has backed up the file and the file is useful. Is there a "set and forget" solution?


Serverless is nice for running low traffic services for free. Azure Functions for example don't start charging until 1M+ executions IIRC.

Transitioning to micro services also makes serverless more appealing since you're getting a separate web server (resiliency) and scaling for free if you need it.


I do agree for the use case of low traffic services but I've not tried Azure yet. What options do you have to avoid runaway costs and "denial of wallet" attacks?


The function app resource itself has a "Daily Usage Quota (GB-sec)"[0], but I'm not sure how useful it is since I've never used it. Overall billing management doesn't have a way to shut off the world if you go over, but alerts can be setup... basically the same as other clouds in this regard. You can also host functions apps on dedicated service plans and not "consumption" (serverless) plans which provides a predictable monthly bill without changing any of your code.

0: https://learn.microsoft.com/en-us/azure/azure-functions/func...


Thank you!


When he says "serverless tax," a term I haven't heard before, is he talking about the development overhead?

If so, the code/test/deploy loop is certainly much faster with this method than any serverless I've messed with.


I think they mean 'serverless' platforms charging extra for bandwidth/build minutes/whatever.


This, sadly, stops right where it gets interesting. Setting up a VM/VServer with Cloudflare and Let's Encrypt is pretty well-covered already.

Why not explain the "serverless" part a bit more? Say, automatically deploy on a new GitHub commit or something.


It's clickbait - this doesn't replace serverless


Coolify is really save my time


This is an insufficient replacement for serverless. No scaling capabilities.


Most people using serverless do not use or need autoscaling.


Almost no one needs autoscaling; most startups won't get any traffic and even ones that jump a bit can run for many years on a tiny vps. Which is why most devs (by far) have no clue what is serverless and run cpanel with WP. There are companies who benefit from scaling obviously, just not that many.


Nevertheless that is part of the value prop, and this does not address it.


Isn’t that covered by the fact that the 4/mo is a VPS and you can log into the Hetzner admin and scale up your server with a few clicked when needed? Unless you mean automatic scaling which fair, that’s not something you can do.


That is only vertical scaling though. Serverless' advantage is that it almost always has horizontal scaling/resilience/failure handling built in


Most people are scaling down to zero (which is cheaper than $4/month last time I checked).


the clear advantage of serverless are: autoscaling and fault tollerance out the box, which single VM doesn't provide. Otherwise it is not clear why one would use serverless..


[citation needed]


That feels so wrong to me:

1st to install node, an arbitrary script is downloaded and executed without having a look into it. Could do anything with the system.

Then `sudo npm install -g pm2` is called. That means the stuff is installed as root "somewhere" in the system - bypassing debians package management.

Then a "process manager" is installed to start/stop/manage a service - on a system that already has systemd doing the same job.

Is that really the way things should be done? Waiting for the day when the tutorial starts with modifying grub.cfg to directly boot into node.


From the very beginning of the article:

> This tutorial is made for beginners ― you only need to be somewhat comfortable with the command line.

> It is made as short as possible and avoids using e.g. Docker to keep things simple. Once you feel comfortable with this setup, you should consider using Docker for easier management or automatically deploying from Github with a webhook.

Even setting that aside and assuming this tutorial was meant for an experienced engineer, your points still feel like nitpicks without substance.

Downloading an "arbitrary script" is not substantially different from downloading an arbitrary executable, which people do anyway.

Of course npm packages bypass debian's package management. On the off chance debian's repositories even have the package in question, I certainly wouldn't trust it to be up-to-date.

pm2 is a popular process manager with features tailored for node apps. That you personally feel it shouldn't be used over systemd, doesn't mean that using it is "wrong".


Do you inspect your neighbors garage workshop for branch safety standards & best practices? Context and proportionality.


Not this. But I'd care if my neighbour would fix his roof without proper safety stuff like a belt or whatever.


Yeah, this ain't it.


There are some things I host this way as well. On the other hand, I find that having autoscaling and automated deploys makes a big difference in speed I can iterate on some side projects.


Get me thinking:

Are there any good vertical autoscalers out there?

If we simply scaled the machine bigger and bigger (and then smaller) as needed, we'd avoid all the complexities of horizontal auto scaling. The limits of vertical scaling would be rather huge these days.

The simple edit/deploy loop of the blog post would remain 100% usable.

The bonus is that it'd work nicely with using sqlite as a datastore as well.


Automated deploys are a matter of two lines of script.

Autoscaling in side projects? My side and your side seems to be different :)


Scaling to 0 can be nice


$4/mo is close to 0 though and I don't run the risk waking up with a 1000$ bill because HN picked up my crappy blogpost.


what's the "serverless tax"?


The premium you pay for serverless versus a VPS with comparable performance/bandwidth requirements.


It’s not a premium — it’s a business decision as to whether based on expects number of requests it makes more sense to pay for a serverless or VPS setup


$4/month for smallest VPS vs the burdensome $0 for first million requests? The author's framing is non-sense.


vs waking up with a $1000 bill because some bored hackers decided to have some fun. With the 4$, it is still $4 no matter what happens.


Scaling/cold-boot time is the real concern IMO no the cost




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: