Hacker News new | ask | show | jobs
by bruce343434 1470 days ago
There's only so much a "apache" or "nginx" can do though in between io operations right? And there's only so much io per second a whole system can do. Basically, from disk to memory, maybe run a language interpreter if the site is not static, then from memory to the internet. Maybe if your pages are very dynamic and involve a lot of scripts it could be worthwhile. Do you have any numbers to back up your claim?
1 comments

I don’t have a reference offhand to hard numbers, but I’ve definitely run webservers which have a significantly higher number of concurrent in-flight requests than number of cores.

Even for a static site, what you’re basically doing is

    page = readFile(“foo.txt”)
    response.write(page)
That’s no CPU usage at all. ~Zero time spent in process. All the time is spent waiting on the data to be loaded into memory from disk, and then copied from memory out onto the network. If you use concurrency for those two functions, then you can handle ~100s of in-flight requests at the same time.