Client body buffering with FastCGI

Maxim Khitrov max at mxcrypt.com
Fri Feb 18 23:17:25 MSK 2011


On Fri, Feb 18, 2011 at 10:28 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> Hello!
>
> On Fri, Feb 18, 2011 at 07:43:09AM -0500, Maxim Khitrov wrote:
>
> [...]
>
>> Here's the information in case you want to see why unix sockets cause
>> this problem. I don't think you even need to use the specific software
>> I was trying to configure. Write a 1-line PHP script that saves some
>> POSTed variable to a file. Then post more than 64 MB of data and see
>> if it breaks.
>>
>> The OS is FreeBSD 7.3-RELEASE-p4 amd64. Nginx 0.8.54 configuration for
>> AjaXplorer with irrelevant parts removed:
>
> [...]
>
>>     sendfile on;
>
> [...]
>
>>             fastcgi_pass unix:/tmp/php.sock;
>
> [...]
>
> Ok, thanks for info.  I tend to think that it's kernel problem
> with sendfile(2) and unix sockets.
>
> Could you please test if a) not using sendfile (in location in
> question) resolves the problem and b) not using unix sockets
> resolves the problem?  Just to make things more clear.
>
> I'll try to reproduce this issue here and dig further into it, but
> unfortunately I'm a bit busy now and it's unlikely to happen
> anytime soon.
>
> Maxim Dounin

Interesting - both a and b solve the problem. I didn't think that
sendfile would be used to transfer the request to the FastCGI socket,
but I guess that's where the problem is.

Which configuration provides more efficient data transfer - sendfile
on with a TCP socket, or sendfile off with a unix socket?

- Max



More information about the nginx mailing list