sendfile EAGAIN support broken?

Maxim Dounin mdounin at
Thu Jan 6 10:09:57 MSK 2011


On Wed, Jan 05, 2011 at 08:01:32PM -0500, steveh wrote:


> Going through the code I couldn't figure our how any retry would be
> triggered / attempted.

This line in your debug log indicate that write event was 
successfully registered:

2010/12/24 18:04:08 [debug] 27169#0: *21 kevent set event: 23: ft:-2 fl:0025

It should be triggered via event loop once write() will be 
possible on connection in question.

> Quite happy to throw some debugging to try and
> identify the problem if someone can point me in the right direction.
> Don't think its possible to remove passenger out the equation as that's
> the only way I've been able to trigger this thus far.

The only suspicious thing in debug log you've provided is strange 
number of bytes sent in initial sendfile() call - i.e. only first 
two memory buffers, but not a single byte from file.  And nothing 
else happens as if not a single byte were read by other side.

Though quick look though passenger nginx module suggest it uses 
unix sockets, and this somewhat explains the above - as unix 
sockets do watermarks autotuning.

So the most possible reason is "other end" (i.e. your application 
and/or passenger) not reading data from socket.

There are no any single sign which suggests there are something 
wrong in nginx.

Maxim Dounin

More information about the nginx mailing list