ENGINEERING ★ 10 upvotes 2024

Ask HN: Replacing Cloudflare Durable Object with Hibernate WebSocket for Hetzner

The Founder's Submission

Direct narrative and submission text authored by @spxneo on Hacker News:

So like the title says im looking at Hetzner's 6 core, 64GB ram for running uWebsocket.js (maybe ill try Bun/Elysia for a small performance hit but tryna squeeze every bit of performance) after I learned how expensive cloudflare durable objects would be (with Hibernate) for 1 million websocket connections (sending 1 message per minute):

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.

Retrospective Overview & Key Insights

Distilled analysis of the business dynamics, operational challenges, and strategic takeaways:

In this technical retrospective (2024), @spxneo shares practical architectural lessons learned from running, scaling, or migrating production software under lean constraints.

Core Principles for Independent Builders:
1
Defaulting to simpler architectures (such as monolithic frameworks, SQLite, or managed VPS) prevents early engineering bankruptcy.
2
Evaluating true compute and egress costs reveals that high cloud bills can often be slashed by 80%+ through judicious re-platforming.
3
Code you write at 2 AM as a solo engineer must be easy to debug six months later without complex microservice dependencies.
Community Debate Themes:

HN engineers debated the tradeoffs between cloud convenience and raw server economics, database indexing strategies, and resisting premature architectural complexity.

Community Discussions & Critical Reviews

High-signal perspectives, counter-arguments, and peer founder insights debated on Hacker News (4 total discussions):

FL @flagged24 Peer Contributor

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 ?

HA @hakanderyal Peer Contributor

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.

HISTORICAL ERA Post-ZIRP & AI (2023–2026)
COMMUNITY SCORE ★ 10 points
TOTAL DISCUSSIONS 4 comments
TOPICS & TECH STACK: