Sendfile EAGAIN and FastCGI

Igor Sysoev igor at sysoev.ru
Fri Jun 17 13:22:34 MSD 2011


On Thu, Jun 16, 2011 at 03:26:24PM -0700, Dave Hayes wrote:
> Hello. I'm using FreeBSD 7.4-RELEASE with Nginx 1.0.3 built from ports:
> 
>  # nginx -V
>  nginx: nginx version: nginx/1.0.3
>  nginx: TLS SNI support enabled
>  nginx: configure arguments: --prefix=/usr/local/etc/nginx
>  --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib'
>  --conf-path=/usr/local/etc/nginx/nginx.conf
>  --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid
>  --error-log-path=/var/log/nginx-error.log --user=www --group=www
>  --with-debug --with-file-aio
>  --http-client-body-temp-path=/var/tmp/nginx/client_body_temp
>  --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp
>  --http-proxy-temp-path=/var/tmp/nginx/proxy_temp
>  --http-scgi-temp-path=/var/tmp/nginx/scgi_temp
>  --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp
>  --http-log-path=/var/log/nginx-access.log --with-http_gzip_static_module
>  --with-http_realip_module --with-http_ssl_module
>  --with-http_stub_status_module --with-http_sub_module --with-pcre
> 
> I'm also using FCGI to run a web application:
> 
>  # pkg_info | grep FCGI
>  p5-FCGI-ProcManager-0.19 Functions for managing FastCGI applications
>  p5-FCGI-Spawn-0.16.1 FastCGI server for CGI-like applications multiprocessing
> 
> It appears when I make a request larger than some value, the debug
> output claims that sendfile() is returning EAGAIN, at which point the
> request times out. Is this my misconfiguration, an nginx bug, an OS bug,
> or something else I've not yet figured out? Debug output follows:

As Maxim already said there is a bug in sendfile/unix socket/FreeBSD
combination. You can just disable sendfile in FCGI location:

    location ... {
        sendfile      off;
        fastcgi_pass  unix:/...
        ...
    }


-- 
Igor Sysoev



More information about the nginx mailing list