uploads buffered to disk

138 views
Skip to first unread message

Claudio Poli

unread,
Feb 12, 2010, 2:17:16 AM2/12/10
to Phusion Passenger Discussions
hi,
I read Hongli states:

Large file uploads are buffered to disk. These buffered file uploads
are immediately deleted after the request has finished.

I'm not observing this behaviour. In fact my /tmp keeps growing and I
need to setup a tmp cleaner to delete old and useless uploaded files.

Eventho I took the necessary steps to delete files older than an hour
I still fear I'll run out of space soon.

What can I do about that? Is this a problem within my code or
Passenger?

thanks

Hongli Lai

unread,
Feb 12, 2010, 3:56:36 AM2/12/10
to phusion-...@googlegroups.com

Although Phusion Passenger deletes its own files, the multipart parsed
files that Rails outputs aren't always automatically deleted. If you
have a tmp cleaner then all is fine.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Claudio Poli

unread,
Feb 12, 2010, 4:00:17 AM2/12/10
to phusion-...@googlegroups.com
hi Hongli Lai,

the problem boils down to how much space one have on their servers. one choice is to upgrade hardware, another chance is to try to find the problem and do something about it.

if you have indications where to look I'll be more than happy.

thanks

> --
> You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
> To post to this group, send email to phusion-...@googlegroups.com.
> To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.
>

Hongli Lai

unread,
Feb 12, 2010, 4:37:01 AM2/12/10
to phusion-...@googlegroups.com
On Fri, Feb 12, 2010 at 10:00 AM, Claudio Poli <maste...@gmail.com> wrote:
> hi Hongli Lai,
>
> the problem boils down to how much space one have on their servers. one choice is to upgrade hardware, another chance is to try to find the problem and do something about it.
>
> if you have indications where to look I'll be more than happy.

If the problem is caused by the parsed multipart temp files as I
suspect, then the problem is not in Phusion Passenger; Rails/Rack
relies on the Ruby garbage collector to delete unused temp files but
this doesn't always happen. Until Rails/Rack has been patched to
delete all multipart temp files at the end of a request, the best
solution you have really is to use a tmp cleaner.

That said, I doubt that you'll run out of disk space if you clean /tmp
every hour. You'll have to have *a lot* of simultaneous large uploads
to do that.

Claudio Poli

unread,
Feb 12, 2010, 4:52:57 AM2/12/10
to phusion-...@googlegroups.com
> If the problem is caused by the parsed multipart temp files as I
> suspect, then the problem is not in Phusion Passenger; Rails/Rack
> relies on the Ruby garbage collector to delete unused temp files but
> this doesn't always happen. Until Rails/Rack has been patched to
> delete all multipart temp files at the end of a request, the best
> solution you have really is to use a tmp cleaner.

thanks for the clarification, I was skimming through rails' code and found some confirmation, seems like rails is adding a subclass to ruby's TempFile and augment it with some accessor, I'm not finding much else, I might want to try looking in Rack.

> That said, I doubt that you'll run out of disk space if you clean /tmp
> every hour. You'll have to have *a lot* of simultaneous large uploads
> to do that.

I do :)

Reply all
Reply to author
Forward
0 new messages