3 ms·
Is that true even if you configure Apache to use a static number of processes? IE set startservers equal to serverlimit and maxsparethreads equal to maxrequestw
by tempestn 3y ago
Is that true even if you configure Apache to use a static number of processes? IE set startservers equal to serverlimit and maxsparethreads equal to maxrequestworkers? IME that allows Apache to respond to load spikes more quickly. But is the issue with high load and dynamic content specifically related more to connecting to the process manager for the scripting language? (I take the same approach there, using a static pool of processes. Haven't had any issues, but have no way of knowing if nginx might be even faster!)
- water9 3y agoNginx 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.