Andy Wrote:
-------------------------------------------------------
> I was always under the impression that Nginx is
> non-blocking for file IO. Then I was told it
> wasn't.
Actually AIO support was added not so long ago. It can be non-blocking for file IO on systems with AIO.
> If Nginx blocks for file IO, then
> using Nginx here wouldn't be any better than using
> Apache, right?
How is it even related? There is a difference between getting a file from disk and serving it to the client from buffer. You can get it really fast and block for a very little time but than send it to the client very slowly. So asynchronous front-end would be a really good idea.
Other than that you might find that neither nginx nor apache can serve your images fast enough from any common filesystem. You will need something like Bitcask to go farther. The idea is to get an entire image to the buffer in a single disk seek.