top | item 29989737

(no title)

taterbase | 4 years ago

If memory serves me, nginx succeeded by relying on epoll primitives for handling many connections rather than spinning up a thread per request by default like apache did at the time. That was the big difference back then. These days I imagine Apache has adopted/honed these same techniques.

discuss

order

mdasen|4 years ago

Yep, epoll was a big part of it making it work around async io rather than threaded.

If someone is interested in reading more, "Flash: An Efficient and Portable Web Server" is a good read on the topic: https://www.usenix.org/legacy/events/usenix99/full_papers/pa.... It has no relation to Adobe Flash.

epoll has the advantage of operating in O(1) time rather than O(n) time as well which becomes important when you have a lot of file descriptors.

I'd also note that epoll landed with Linux 2.6 so it wasn't really available before 2004. Apache Server was created in 1995 long before epoll and Nginx was initially released in 2004. It's one of those situations where you introduce new capabilities like epoll being able to handle lots of FDs in O(1) time and someone finds a way to use that capability to make something great.

zerr|4 years ago

Although, similar facilities were already available in other systems such as Solaris, Windows NT, FreeBSD.

closeparen|4 years ago

Was epoll around and no one was using it for a web server yet? It seems like something that would have been put in the kernel explicitly at the behest of web servers.