[Catalyst] Re: Handling slow uploads externally

A. Pagaltzis pagaltzis at gmx.de
Thu Apr 12 20:25:57 GMT 2007

Hi Brian,

* Brian Kirkbride <brian.kirkbride at deeperbydesign.com> [2007-04-12 19:25]:
> 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.
> […]
> 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.

My suggestion is to do something much more transparent.

Use a CGI script on the front-end webserver to accept uploads.
When the upload completes, the CGI script then in turn makes a
HTTP request to the application webserver server to upload the
file, and returns the app’s response to the client.

That way, the actual application itself does not need to change
at all. There is no serialisation mechanism, no extra code in the
application to handle such a special upload mechanism, no need
for configuration of filesystem paths or other shared resources,
nothing. The handling is isolated on the front-end webserver.

This way, a programming consideration becomes a mere deployment

HTTP is great like that.

> 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?

Sometimes, there is no code to do something because no code is
needed to do it. :-)

Aristotle Pagaltzis // <http://plasmasturm.org/>

More information about the Catalyst mailing list