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

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

 



cron is a good idea, havent thought about that. One could use the nice
program then to give it the lowest priority, because other requests are more
important than this and another server gives the issue of transfering files
back and forth. Another soln would be to run it with & in the background
(with nice) and then check if the file(s) exist on ajax calls to give
feedback, this might actually be easier to implement.

Anyway, we will fix the issue later now. Thanks.

Tim-Hinnerk Heuer

http://www.ihostnz.com


On Tue, Dec 23, 2008 at 7:21 PM, Nathan Nobbe <quickshiftin@xxxxxxxxx>wrote:

> 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