Comment by znpy

4 days ago

1000 connections is a fairly low number by modern standards, c10k “challenges” are like twenty years old by now.

The real questions are:

- how many messages per second are you processing on that 2gb machine (and using how many cpus)?

- does your message processing involve transaction handling, including saving data ti disk durably?

No offense but it really seems you’re comparing apples and oranges, with your use case being much much simpler than the one described.

These are all very conservative back of the napkin calculations. Also, this isn't 1000 connections. It's 1000 customers, each of which can consume dozens of connections.

My point here is that it is important to match the tech stack to the challenge you're facing. When I started thinking about how to solve this problem my first reaction was to design an overly complicated distributed message queue using PG Notify, Redis, Kafka or something along those lines. The key takeaway here is that I realized that I probably wouldn't end up with more than 1000 customers, so I just needed to design a system that could comfortably handle that level of traffic without much effort. If, by some miracle, my business goes crazy viral, I know that my cloud provider can probably handle up to 200,000 customers by just updating a slider in my dashboard, which is way more business than I want anyway.

Engineers love to fantasize about Google levels of scale, but that's just not realistic for a lot of services.

  • Engineers also love to reinvent the wheel.

    What you wrote is essentially technical debt.