Live data from Hacker News

My £4 a month server can handle 4.2M requests a day

mark.mcnally.je

71–80 of 479 posts

Re: My £4 a month server can handle 4.2M requests a day

#72

Normally benchmarks for things like this are measured in how many concurrent requests can be handled, i.e the C10K problem, not by how many requests you are able to serve in a day. It's also well known that you can serve a large amount of requests on limited hardware. https://en.wikipedia.org/wiki/C10k_problem "By the early 2010s millions of connections on a single commodity 1U rackmount server became possible: over…

How does a single server run millions of active connections?

Wouldn't you run out of TCP sockets?

What am I missing?

Re: My £4 a month server can handle 4.2M requests a day

#73

Earlier quoted context omitted.

Weird, this site loads really fast for me actually. Much faster than most sites that I visit.

Thanks! Just goes to show that it runs quickly even when it hits #1 on HN ;)

Hey OP, in case it wasn't clear from my original comment, I am impressed with how stable your site is! "A few seconds" is wonderful for a #1 post, and far better than what usually happens to lightly-hosted sites that get to this point. Those are usually timeouts or outright failures to connect.

I just figured I'd start some conversation on the post, since there wasn't any comments when I initially looked. For better or for worse it seems like I got people talking.

Re: My £4 a month server can handle 4.2M requests a day

#74
post #68

How did this make it to the number two spot on HackerNews?

An awful lot of professional programmers work in such heavyweight contexts that they don't have a good idea of how fast modern hardware can be. I was talking with an architect at a bank whose team was having trouble getting under a 2-second maximum for page views. They blamed it on having to make TCP requests to other services, and said something like "at a couple hundred milliseconds per request, it adds up quickly!…

I had a discussion with a coworker about something about slow memcpys, that roughly went the same way except... you know, DDR4 RAM has a speed of roughly 40GBps.

Also, that "awful" 1MB memcpy is likely all in L3 cache these days. But even if it weren't in cache, we're talking about an operation that takes 50 microseconds (1MB read + 1MB written == 25microseconds + 25 microseconds).

Given that modern CPUs have like 16+ MBs of L3 cache (and more), and some mainstream desktop CPUs have 1MB of L2 cache... its very possible that this memcpy is far faster in practice than you can imagine.

1MB is big, its a million bytes. But CPUs are on the scale of billions, so 1MB is actually rather small by modern standards. Its surprisingly difficult to get intuition correct these days...

Re: My £4 a month server can handle 4.2M requests a day

#76
post #72

Normally benchmarks for things like this are measured in how many concurrent requests can be handled, i.e the C10K problem, not by how many requests you are able to serve in a day. It's also well known that you can serve a large amount of requests on limited hardware. https://en.wikipedia.org/wiki/C10k_problem "By the early 2010s millions of connections on a single commodity 1U rackmount server became possible: over…

How does a single server run millions of active connections? Wouldn't you run out of TCP sockets? What am I missing?

A connection isn't just a dest_port, it's the unique combination of 4 components: source_ip:source_port:dest_ip:dest_port

Re: My £4 a month server can handle 4.2M requests a day

#77
post #72

Normally benchmarks for things like this are measured in how many concurrent requests can be handled, i.e the C10K problem, not by how many requests you are able to serve in a day. It's also well known that you can serve a large amount of requests on limited hardware. https://en.wikipedia.org/wiki/C10k_problem "By the early 2010s millions of connections on a single commodity 1U rackmount server became possible: over…

How does a single server run millions of active connections? Wouldn't you run out of TCP sockets? What am I missing?

socket multiplexing

Re: My £4 a month server can handle 4.2M requests a day

#78
post #67

People tend to severely underestimate how fast modern machines are and overestimate how much you need to spend on hardware. Back in my last startup, I was doing a crypto market intelligence website that subscribed to full trade & order book feeds from the top 10 exchanges. It handled about 3K incoming messages/second (~260M per day), including all of the message parsing, order book update, processing, streaming to we…

People may underestimate how fast modern machines are, but that is probably in part because, at least in my fairly relevant experience, I have literally never seen a CPU bottleneck under normal circumstances. Memory pressure is nearly always the driving issue.

Yeah. Now that CPUs are insanely powerful and you have NVMe SSDs etc the bottleneck is always memory.

Re: My £4 a month server can handle 4.2M requests a day

#79
post #41

What's the point of this post? OP is serving a file at 50req/sec. There is not even mention of a dB query. How is that able to relate to any kind of normal app? I guess that the post was written as an answer to the mangadex post [1]. Mangadex was handling 3k req/sec involving dB queries. It was not just a cached Html page. 50req/sec for a Html file is super low which shows that a $4 month server cant do much actually…

Exactly, I dont see the point bragging about this nevertheless posting about it on HN ...

Re: My £4 a month server can handle 4.2M requests a day

#80
post #49

People tend to severely underestimate how fast modern machines are and overestimate how much you need to spend on hardware. Back in my last startup, I was doing a crypto market intelligence website that subscribed to full trade & order book feeds from the top 10 exchanges. It handled about 3K incoming messages/second (~260M per day), including all of the message parsing, order book update, processing, streaming to we…

I'm running a crypto trading platform I'm developing on 30$ on DigitalOcean. I coded exclusively in Rust and recently added a dynamic interface to python. Today during the BTC crash it spiked at 20k events/s, and that's only incoming data.

is that $30 for a single droplet or is it spread out between a few different services? I'm kind of curious since I use DO for small projects myself.
Post reply on HN