[Catalyst] Handling slow uploads externally

Brian Kirkbride brian.kirkbride at deeperbydesign.com
Thu Apr 12 18:16:16 GMT 2007

Hello all,

I have a CMS-like application using Catalyst for which about 40-50% of requests 
contain large file uploads.  I'm using a pretty standard two-tiered setup to 
avoid tying up heavy mod_perl procs for slow client downloads.

Now I'd like to avoid tying up the heavy procs for slow uploads.  Many suggest 
to run upload handlers as CGI rather than mod_perl because the 1s startup time 
is negligent compared to the time required to upload.  I have tried this and it 
works, but it still creates a 60+ MB process to sit around for 2 minutes while a 
dial up user uploads a huge image.

I'm thinking of splitting file upload handling out to a simple CGI app (no 
Catalyst code) that serializes the request, including uploaded files, to a tmp 
directory.  It would then redirect to a Catalyst-handled URL matching the 
serialized request.  Then I can validate the submission in Catalyst and display 
success or error using my views, etc.

Is there something like this in existence already?  I searched Google and CPAN 
but didn't find anything promising.  I'd appreciate any tips or suggestions.  If 
I do implement it from scratch, would there be any interest in the CGI and a 
Catalyst base controller being released on CPAN?

Brian Kirkbride

More information about the Catalyst mailing list