Welcome! Log In Create A New Profile

Advanced

Re: Does Nginx block on file IO?

Justin Cormack
May 02, 2011 07:08AM
On Mon, 2011-05-02 at 07:29 +0200, Piotr Sikora wrote:
> Hi,
>
> > 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.
>
> It's actually very related, because with event-driven programming, you're
> blocking _all_ worker's clients on the single disk I/O.

If you expect file IO to block, use more nginx processes than cores. I
dont think that async IO on Linux is really worth using, although I will
do some benchmarks. You might try switching to FreeBSD as well.

I think that node.js currently uses a thread pool for async IO on Linux
(possibly all platforms, except maybe Windows), with sync IO in the
background. Linux kernel aio was designed for programs like databases
that manage their own buffer caches, not for normal file IO. If you dont
cache the results it will be slow (unless anything has changed recently,
will do some testing).

Justin



_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Does Nginx block on file IO?

Andy May 01, 2011 08:26PM

Re: Does Nginx block on file IO?

jjjx128 May 01, 2011 09:54PM

Re: Does Nginx block on file IO?

Piotr Sikora May 02, 2011 01:24AM

Re: Does Nginx block on file IO?

Piotr Sikora May 02, 2011 01:30AM

Re: Does Nginx block on file IO?

Justin Cormack May 02, 2011 07:08AM

Re: Does Nginx block on file IO?

jjjx128 May 02, 2011 07:17AM

Re: Does Nginx block on file IO?

jjjx128 May 02, 2011 07:25AM

Re: Does Nginx block on file IO?

Cliff Wells May 02, 2011 02:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 225
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready