| ▲ | lelanthran 3 hours ago | |||||||
> Because if you use one thread for each of your 10,000 idle sockets you will use 10GB to do nothing. 1.On a system that is handling 10k concurrent requests, the 10GB of RAM is going to be a fraction of what is installed. 2. It's not 10GB of RAM anyway, it's 10GB of address space. It still only gets faulted into real RAM when it gets used. | ||||||||
| ▲ | n_e 3 hours ago | parent | next [-] | |||||||
> 1.On a system that is handling 10k concurrent requests, the 10GB of RAM is going to be a fraction of what is installed. My example (and the c10k problem) is 10k concurrent connections, not 10k concurrent requests. > 2. It's not 10GB of RAM anyway, it's 10GB of address space. It still only gets faulted into real RAM when it gets used. Yes, and that's both memory and cpu usage that isn't needed when using a better concurrency model. That's why no high-performance server software use a huge amount of threads, and many use the reactor pattern. | ||||||||
| ||||||||
| ▲ | com2kid 3 hours ago | parent | prev [-] | |||||||
> 1.On a system that is handling 10k concurrent requests, the 10GB of RAM is going to be a fraction of what is installed I've written massively concurrent systems where each connection only handled maybe a few kilobytes of data. Async io is a massive win in those situations. This describes many rest endpoints. Fetch a few rows from a DB, return some JSON. | ||||||||