5 ms·
Nginx uses an event driven model where a single thread might perform work for multiple requests. Often the batching and caching of these requests can boost perf
by water9 3y ago
Nginx uses an event driven model where a single thread might perform work for multiple requests. Often the batching and caching of these requests can boost performance. Apache however assigns each inbound connection its own dedicated thread which makes it slightly more responsive on average. At the end of the day it's going to come down to the priority of scheduling for the threads of the program whether it be one process with 65,535 threads or 65,535 single threaded processes
- xorcist 3y agoThat description is not correct for any of them. Apache can use either an event queue or a thread pool, and nginx is also multithreaded and not forking. So there isn't any difference, except that Apache has a bit more knobs to tweak.
- water9 3y agoNGINX is multiprocess Single Threaded Apache is one thread per connection Its like having the same waiter vs a pool of waiters Sources: https://serverguy.com/wp-content/uploads/2020/10/Apache-Vs-NGINX-Infographic_Edit-2_New-SG-Logo.png https://serverguy.com/wp-content/uploads/2020/10/Apache-Vs-N... https://www.google.com/search?rlz=1C1CHBF_enUS874US874&sxsrf=APwXEdcNR7H8yr2Iu7i9S9_FCIJgxziYPA:1684659916505&q=Is+NGINX+single+threaded+or+multithreaded https://www.google.com/search?rlz=1C1CHBF_enUS874US874&sxsrf...
- xorcist 3y agoThat is just a png of some text. The text is either wrong or outdated by a decade or more. People sometimes like to have opinions about stuff. But there's no reason to google for secondary sources when the documentation is good. Read the manual instead. The documentation for both projects is correct, short and to the point. They are both multi threaded, multi process, with an event loop. The documentation describes how to set those parameters. Look at the thread_pool directive for nginx and AsyncRequestWorkerFactor for Apache for example. You could of course configure one thread per connection, but that only makes sense under specific circumstances.