89 points · by Tsiolkovsky · 15y ago · 35 comments
What we will see is 2.4 (general/public release). And it won't really be stable / product-ready until about 6 months after: 2.4.8.
http://httpd.apache.org/docs/2.3/new_features_2_4.html
http://httpd.apache.org/docs/2.3/developer/new_api_2_4.html
The MPM for Windows is really great, it takes full advantage of the threaded nature of processes on Windows ... You can spin up 100s of threads in 1 process without much of an impact and have each thread do 1 connection (with a low 1 or 2 seconds keepalive to keep the client).
I'm mostly interested in Apache on Windows and have toyed around with the idea of including v2.3 in my WAMP distribution ( http://www.devside.net/server/webdeveloper ) in the experimental branch, with also some MySQL replacements such as MariaDB and Drizzle.
* Robust: that's reflected in its internal API that makes it near impossible to leak resources.
* Extensible: witness the gazillion modules out there.
* Portable: compiles and runs on very exotic or outdated systems. SCO, IRIX, Digital UNIX, VMS, the list goes on.
nginx and such were designed from the ground up with performance in mind - and with success - but the trade-off is a lack of portability and an API that is much harder to program to.
Because they've become totally irrelevant.
Seems like a waste of resources when there are more pressing things to do than worry about the 5 people who (a) use VMS and (b) demand a bleeding-edge Apache.
On the other hand, for long-lived connections, you're better off using blocking IO since it's more efficient. Most web traffic is not long-lived, though. See Paul's interesting article on NIO vs IO performance:
http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-...
http://www.mailinator.com/tymaPaulMultithreaded.pdf
And don't forget about Slowloris. If you see your competition using Apache, you really don't need to worry. :)
Disclaimer: I have nothing personal against Apache and used it for six years or so. I've just moved on to better software. If it works for you, that's great.
Also, a properly configured Varnish placed in front of Apache ruins Nginx at almost anything at scale. I've seen it.
Most web traffic is not long-lived, though.
But most web traffic is blocking. Going NIO requires caching - which is a huge penalty and a PITA; and doing it while not having actual users doesn't make sense.Event MPM: The Event MPM is no longer experimental but is rather fully supported.
Asynchronous support: Better support for asynchronous read/write for supporting MPMs and platforms.
0) People don't know how to use PHP with it: module or fastcgi; and which MPM to use here.
1) People don't know how to configure the MPM setting to allow Apache full use of server resources (without under-utilizing or over-utilizing).
2) Apache is a full / well-rounded web server application... It's not a specialty server (ex: static content mostly) that can exclude this and that and only provide 1 feature to excel at. Other servers are stripped down compared to Apache.
* Not the AMA guy (nor an Apache hacker guy), buy have a little known WAMP distribution (called WampDeveloper, used to be Web.Developer Server Suite) since 2003 with over 250,000 unique ip downloads between 2003-2006 (have stopped counting), and have worked on 1000s of issues for users and clients since the start.
But on the same server, using PHP-FPM with FastCGI on both lighttpd and Apache I am serving almost 4x the requests that Apache is serving with less memory overhead. Switching the sites that are currently running on Lighttpd back to Apache as I attempted to do not to long ago to only have to maintain a single server made Apache die a miserable fast death. It just could not keep up, I've had friends look over my config (datacenter techs, help people scale their stuff, porn mostly) and they said it looked fine. Apache was the limiting factor here.
I moved from prefork to threaded, that helped a little, but not much. Apache was just using a lot of memory, and overall did not provide the performance I wanted. Switched back to lighttpd, load on the server went down, and the websites were responsive as before.
Any tips on getting started with module development?
I use emacs and gdb to muck around the code. Apache has a lot of backwards compat warts with regard to which header files define things, unfortunately, but grep (or ack) and ctags will get you around.
The best way (by far) to learn about module hackery is with Nick Kew's book, http://www.amazon.com/Apache-Modules-Book-Application-Develo...
`httpd -X` and `gdb httpd $(pidof httpd)` are a great help when debugging.
[1] http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/
Does it fall back to worker when its used under SSL?
With pre-fork and threaded, every connection takes up a process or thread. This sucks for keep-alive because it can take a while before the client issues the next request.
The event MPM puts that idle connection in a kqueue/epoll/etc. pollset and recycles the process/thread for another request.
It's a conceptually simple change but it has some profound performance implications.
I like many things about Nginx. The fact that it is a production-capable web server out of the box, for example. I know that is probably not a high-priority design goal for Apache for historical reasons, but it seems a very sensible default in 2011.
In fact, IIRC, if you are using apche as a reverse proxy (mod_proxy) the event mpm should become the standard as it will detach the worker thread both for keepalive on the front end, and when waiting on response from the backend.
It already has had support since the start (though non-ASF)...
It would be unwise to release a new protocol without releasing a proof-of-concept tie-in for an already existing web server, unless you want the project to be DOA.