On Mon, Nov 15, 1999 at 01:14:43PM -0500, Todd Finney wrote:
> We're putting together a site that involves processing images uploaded by
> our users. I'm using Image::Magick to resize the images to a standard
> size, and to create thumbnails. We will have an upload page, which hits
> a CGI under mod_perl that handles the form data and processes the image.
>
> I am wondering if this is the best way to handle this. When a user
> uploads an image and it's being processed, am I occupying an entire child
> process for the duration of the transaction? If each transaction lasts a
It does occupy that child process.
> couple of seconds, it this a Bad Thing? Is there a more efficient way to
Depends on your server, your visitor volume, and your standards of Bad.
> handle this?
Probably so, but only your own usage is likely to demonstrate proof. An
alternative would be to accept the upload, add the picture to the database
that I infer you have, and tag it as needing to go through Image::Magick.
Every so often, perhaps with a cron job, process your accumulated work with
a plain perl script, fixing up the database as you go to reflect that the
work got done.
Of course, that makes assumptions like "you're using a database" et cetera.
Adjust as required.
Hope this helps.
Randy