Forum: NGINX tmp directory filling up

2974d09ac2541e892966b762aad84943?d=identicon&s=25 Tatonka (Guest)
on 2014-06-11 16:59
(Received via mailing list)
Hi,

I have a rails application that is hosted through nginx and passenger.
In
this application I want provide very large files for the users to
download
(>2GB) using send_file .. which is working just fine on the development
and
staging system. On the production system however the system tmp
directory is
limited to 1GB (separately mounted disk).

When triggering a download, the tmp folder quickly fills up and the
download
breaks once it is completely full. I already moved passengers /tmp
directory
to a new location but could find how to do the same for nginx (I did set
$tmp and $tmpdir with no effect).

When looking into the /tmp directory however, I cannot find any large
files
that would explain what is happening, nevertheless, df reports it is
filling
up at the same time ..

Lastly .. I also specified the proxy_temp_path directive in the nginx
config. Again with no effect.

Is there any way to specify which directory nginx uses for its tmp data?
Is
nginx even the culprit here?

Thanks .. any help is greatly appreciated.

Thanks
Tim

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,250795,250795#msg-250795
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-06-11 21:23
(Received via mailing list)
Hello!

On Wed, Jun 11, 2014 at 10:58:47AM -0400, Tatonka wrote:

> to a new location but could find how to do the same for nginx (I did set
> $tmp and $tmpdir with no effect).
>
> When looking into the /tmp directory however, I cannot find any large files
> that would explain what is happening, nevertheless, df reports it is filling
> up at the same time ..
>
> Lastly .. I also specified the proxy_temp_path directive in the nginx
> config. Again with no effect.

The proxy_temp_path is related to the problem, but it's for proxy,
not for passenger, and it's expected that it has no effect in your
case.

> Is there any way to specify which directory nginx uses for its tmp data? Is
> nginx even the culprit here?

That's not about nginx, but rather about passenger module for
nginx.

Last time I checked, passenger module for nginx implemented its
own protocol for the upstream module (like proxy/fastcgi/etc), and
should have its own "..._temp_path" directive, as well as
"..._max_temp_file_size" and so on.

--
Maxim Dounin
http://nginx.org/
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Tatonka (Guest)
on 2014-06-12 08:57
(Received via mailing list)
Hi Maxim,

thanks for your answer.

I tried redirecting passengers tmp dir as well using the tmp_dir
directive
as well as using the env variables. For the "regular" passenger tmp
files,
this seems to work fine (they appear in the new location).

My main problem is that I can't even see the file that is using up so
much
space in the /tmp dir and am quite frankly at a loss how that is even
possible.

Anyways. Thanks for your help. I'll try to dig into the passenger config
a
little more.

Tim

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,250795,250813#msg-250813
A7772d75f782075312a124f5c10bf036?d=identicon&s=25 Andrei Belov (Guest)
on 2014-06-16 13:22
(Received via mailing list)
On 11 Jun 2014, at 23:23, Maxim Dounin <mdounin@mdounin.ru> wrote:

>> limited to 1GB (separately mounted disk).
>> Lastly .. I also specified the proxy_temp_path directive in the nginx
> nginx.
>
> Last time I checked, passenger module for nginx implemented its
> own protocol for the upstream module (like proxy/fastcgi/etc), and
> should have its own "..._temp_path" directive, as well as
> "..._max_temp_file_size" and so on.

Its still true:

https://github.com/phusion/passenger/blob/master/e...

It uses NGX_HTTP_PROXY_TEMP_PATH which is set at configure stage.
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-06-16 16:27
(Received via mailing list)
Hello!

On Mon, Jun 16, 2014 at 03:22:11PM +0400, Andrei Belov wrote:

> >> this application I want provide very large files for the users to download
> >> that would explain what is happening, nevertheless, df reports it is filling
> >> nginx even the culprit here?
>
>
https://github.com/phusion/passenger/blob/master/e...
>
> It uses NGX_HTTP_PROXY_TEMP_PATH which is set at configure stage.

And it looks like it doesn't provide relevant directives, so the
only option left is to switch off buffering completely, using the
"passenger_buffer_response" directive (which is again incorrectly
named, it should be "..._buffering").

Well, I never had a reason to say anything good about passenger,
so it's at least consistent...  ;)

--
Maxim Dounin
http://nginx.org/
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.