Re: shell_exec seems to hang other web requests while running convert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 22, 2008 at 9:06 PM, German Geek <geek.de@xxxxxxxxx> wrote:

> Hi All,
>
> The following problem:
>
> Our client is converting pdfs to images with a web interface. At the moment
> I'm using convert from imagemagick with shell_exec (i know i could use the
> imagick module, but this would require quite a bit of recoding and time at
> the moment, it was originally running on a windows machine and i couldnt
> get
> the imagick module working on that).


wow, i totally here you on the we cant change our imagemagick setup right
now ;)

But still while these 3
> images are converted (can take 20-30 seconds) other requests seem to hang
> until convert is finished. I know, i can put a & at the end of the command
> line but then they wouldnt know when the process is actually finished.


its very common to treat objectives which take more time to complete in an
asynchronous manner.  typically the http request will place a 'command' into
a queue, which is picked up by a cron job.  then the user is notified upon
completion by an email or some other web page, which they can go to review
at a later time.

this will not help your server load at all however, if youve only got 1
box.  the cron will be running and eating juice that the webserver would
like to have.  best bet is to scale out by tossing another server in the mix
to handle the imagemagick stuff.  whether or not you want to keep things
real-time or move to a cron-based solution is up to you.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux