Live data from Hacker News

Boosting Nginx Performance with Thread Pools

nginx.com

1–10 of 48 posts

Re: Boosting Nginx Performance with Thread Pools

#2
Great explanation of an event driven web server. Helped me understand ome of the benefits of the mongrel2 architecture that separates the tasks needed to be done completely by using ØMQ as the mechanism to decouple the connection handling from the message handling of the request.

Re: Boosting Nginx Performance with Thread Pools

#5
I think this would have been much better titled "Boosting NGINX Performance 9x with Asynchronous wrappers around blocking system calls".

Most people when hearing about "thread pools" in the context of a web-server think about using multiple threads for handling separate requests, which is NOT what this is about. It is using threads to enable some blocking syscalls (read and sendfile) to run asynchronously from the main event loop.

There's already a library for that! http://software.schmorp.de/pkg/libeio.html

Re: Boosting Nginx Performance with Thread Pools

#6
I don't think that a load of 172 is a good idea. I know this is a benchmark that is measuring how fast you can go ideally but in production the question is how fast you can go with with keeping the latency within the SLA. As a general rule you want to run your boxes around 1 normalized load ( load / # of CPU cores). The rest of the article is pretty nice.

Re: Boosting Nginx Performance with Thread Pools

#7
The design seems similar to the one suggested in the 1999 USENIX paper "Flash: An Efficient and Portable Web Server". It's a good read on the topic. nginx came about in a time where you're a lot more likely to have your site cached in RAM than in 1999 (along with offloading large files to a CDN/S3 and reverse-proxying to an app server for a lot of other stuff), but it's nice to see them working on making performance better for the bad cases.

https://www.usenix.org/legacy/event/usenix99/full_papers/pai...

Re: Boosting Nginx Performance with Thread Pools

#8
post #5

I think this would have been much better titled "Boosting NGINX Performance 9x with Asynchronous wrappers around blocking system calls". Most people when hearing about "thread pools" in the context of a web-server think about using multiple threads for handling separate requests, which is NOT what this is about. It is using threads to enable some blocking syscalls (read and sendfile) to run asynchronously from the ma…

Similarly, there's libuv [0], which is used for Node.js and others.

[0] https://github.com/libuv/libuv

Post reply on HN