News for hackers. Stuff that matters.
Re:The long life of Apache httpd 2.4 by water9 on Saturday May 20, 2023 @05:20AM (#36010456)
HAProxy is faster than both of them for load balancing. Apache is slightly faster for static content. Nginx has more responsiveness under high load than Apache for dynamic content (Hence Tomcat workers for example)
Re:The long life of Apache httpd 2.4 by tempestn on Saturday May 20, 2023 @05:31AM (#36010501)
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!)
Re:The long life of Apache httpd 2.4 by water9 on Saturday May 20, 2023 @04:18PM (#36015186)
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
Re:The long life of Apache httpd 2.4 by xorcist on Saturday May 20, 2023 @05:13PM (#36015686)
That 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.
Re:The long life of Apache httpd 2.4 by water9 on Sunday May 21, 2023 @05:09AM (#36019140)
NGINX 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-N...

https://www.google.com/search?rlz=1C1CHBF_enUS874US874&sxsrf...

Re:The long life of Apache httpd 2.4 by xorcist on Sunday May 21, 2023 @05:22AM (#36019191)
That 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.

Re:The long life of Apache httpd 2.4 by blacklion on Saturday May 20, 2023 @03:04PM (#36014640)
Does Apache can do zero-copy for static content? nginx could on properly configured system.

TLS kills this, alas, and, I think, with TLS OpenSSL will be bottleneck for static content, not server.

Re:The long life of Apache httpd 2.4 by water9 on Saturday May 20, 2023 @04:14PM (#36015154)
I think it has more to do with the event driven nature of nginx vs the thread per connection nature of Apache.
Re:The long life of Apache httpd 2.4 by toast0 on Saturday May 20, 2023 @10:13PM (#36017387)
If you're looking for this, you want kTLS, plus or minus nic accelerated kTLS. Read the Netflix CDN presentiatons for the state of the art, and see what you can make work with your system, etc.
Re:The long life of Apache httpd 2.4 by blacklion on Sunday May 21, 2023 @11:17AM (#36021827)
I know abut Netflix work, and even some of this work trickled down to base FreeBSD (and opensource), but is still very fragile, not completely open-sourced and require very special hardware (1 or 2 models of specific NICs with specific versions of firmware) to work.
Re:The long life of Apache httpd 2.4 by rb12345 on Monday May 22, 2023 @08:51AM (#36030777)
"EnableSendfile On" will enable that on Apache, and has been around since Apache 2.0.44. It's not enabled by default though, and as you say, TLS breaks it.