Welcome! Log In Create A New Profile

Advanced

Re: How fastcgi temp works?

Maxim Dounin
January 30, 2014 08:44PM
Hello!

On Thu, Jan 30, 2014 at 12:44:25PM -0500, portoist wrote:

> Hello everybody,
> We are using nginx with php-fpm. Our application works as download
> aggregator. We download files from 3rd party servers and send it to client
> while it's still being downloaded. It means that we can't use
> X-Accel-Redirect, since file isn't fully downloaded and X-Accel-Redirect
> sets Content-Length to actual file size. We set required headers in php and
> in cycle read chunks of file, prints it and flush it to output. Everything
> seems to work fine except large files (over 1GB) on slow download speeds.
> Downloading was interrupted at 1GB - it seemed like client has disconnected
> - calling connection_aborted in php returned true. I have found out that
> fastcgi_max_temp_file_size is 1GB by default - so I have increased it to
> 2GB.
> Now how exactly does fastcgi temp file works? Does every request has its own
> temp file? Or is there one common temp file?
> Thanks for hints!

Some hints can be found here:

http://nginx.org/r/fastcgi_buffering

Downloading is _not_ interrupted by nginx after reaching 1GB, but
it will stop loading further data from a backend till already
buffered data are sent. This may take a while if client
connection is slow, leading to timeouts on backend's side.

--
Maxim Dounin
http://nginx.org/

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

How fastcgi temp works?

portoist January 30, 2014 12:44PM

Re: How fastcgi temp works?

Maxim Dounin January 30, 2014 08:44PM

Re: How fastcgi temp works?

portoist January 31, 2014 02:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 324
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