(no title)
asien | 3 years ago
Has been the historic assumption, has been proven to be wrong by every possible benchmark.
Consider tech empower[0] for raw stack performance , runtime level threads outperform IO threads since OS thread were designed to be mapped on physicals cores.
This is very expensive and inefficient.
Creating one thread for every request you have ( Apache + PHP ) will exhaust the hardware after a few thousands/qps target.
Runtime can indeed have millions of those “lightweight threads” without killing your machine since they create a pool from physical threads and tap into IO events to efficiently switch or resume contexts. This is by far much faster.
[0] https://www.techempower.com/benchmarks/#section=data-r20&hw=...
astrange|3 years ago
PHP installations more realistically use nginx and FastCGI. This is not one thread per request and it’s also a better design than hosting your entire server and every user request in the same process; that’s just asking for security issues.