Aio vs non-blocking-io

Hello,

Is there a chance to use non-blocking-io with nginx?
AIO is quite broken on Linux, but “O_NONBLOCK” is not.
I know, AIO would be better because you don’t have to wait
until the buffer is copied to the kernel-space, but what should
we do…

The problem, nginx is quite often in “uninterruptible sleep” (D),
so the whole process is blocked.

Thanks a lot
Marcus

Posted at Nginx Forum:

Hi,

I know, AIO would be better because you don’t have to wait
until the buffer is copied to the kernel-space, but what should
we do…

Move away from Linux.

Best regards,
Piotr S. < [email protected] >

Hello!

On Sun, Dec 11, 2011 at 06:58:57PM -0500, double wrote:

Is there a chance to use non-blocking-io with nginx?
AIO is quite broken on Linux, but “O_NONBLOCK” is not.

Does O_NONBLOCK works on Linux for regular files? If yes, where
is sematics defined?

POSIX says behaviour of O_NONBLOCK on regular files is
unspecified, and it’s indeed impossible to use O_NONBLOCK on
regular files with POSIX interfaces: there is no way to schedule
read operation and there is no way to find out if I/O possible
(select()/poll() always return regular files as ready for
reading/writing as per POSIX).

Maxim D.

On 12/12/2011 02:02 AM, Piotr S. wrote:

Hi,

I know, AIO would be better because you don’t have to wait
until the buffer is copied to the kernel-space, but what should
we do…

Move away from Linux.

Does nginx provide better performance under other operating systems?