Ask HN: Replacing Cloudflare Durable Object with Hibernate WebSocket for Hetzner
4 comments
It will be much faster to try it out rather than waiting for internet strangers to answer for these type of questions. I would setup $10-$20 VPS and test max performance then extrapolate from there.
Whenever I read posts like this with millions of requests per small time unit, fighting over dollars. I realize I work in a completely different realm. I have barely 60 concurrent users but these users are paying top dollar for the privilege. Can't you make the revenue per request higher so this becomes a none issue ?
I'm not sure how your comment is relevant here. I'm happy for you though. No I cannot charge money as my services are free.
Going by your bio one could think this is business oriented. Sorry if I missed the mark. Anyway, I doubt anyone is going to run the numbers for you. I would give this a real life test, even if it was just simulated traffic. Hetzner has been a huge cost saving for me.
Requests:
10,000 WebSocket connections * 100 Durable Objects to establish the WebSockets = 1,000,000 initial WebSocket connection requests.
10,000 messages per minute * 100 Durable Objects * 60 minutes * 24 hours * 30 days = 43,200,000,000 requests.
1,000,000 + (43.2 billion requests / 20 for WebSocket billing ratio) = 2,160,010,000 million requests.
(2.16 billion requests - included 1 million requests) * $0.15 / 1,000,000 = $324.00.
Compute Duration:
100 Durable Objects * 100 seconds * 60 minutes * 24 hours * 30 days = 432,000,000 seconds (since now each DO is active for 100 seconds per minute).
432,000,000 seconds * 128 MB / 1 GB = 55,296,000 GB-s. (55,296,000 GB-s - included 400,000 GB-s) * $12.50 / 1,000,000 = $686.20.
Estimated Total:
Requests: $324.00
Compute Duration: $686.20
Minimum $5/mo usage fee.
Total Estimated Monthly Cost: $1015.20.
Now Hetzner's 64gb ram/6-core server costs $40 euros / month should be able to handle 1 million connections here with uWebsocket.js but keep in mind this is the absolute bare minimum and im being conservative (since theoretically 64gb = 6.4 million connections)
Are my calculations/expectations correct here?
Feels a bit scary since I've been on the "cloud" for over a decade, have to look at PaaS/hardening box but the cost savings here is immense.