convert hangs and kills the server

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
codeswitch
Posts: 15
Joined: 2009-09-07T09:33:45-07:00
Authentication code: 8675309

convert hangs and kills the server

Post by codeswitch »

I use imagemagick 6.3.7 to do serveral tasks, e.g. resize and crop an image. To do this I wrote a php script (started by a cronjob every 10 minutes) which takes 15 images and processes every one of them in a loop. Inside a loop there are 8 jobs to be done. One of them looks like this:

convert image.jpg -resize 300x -resize 300x< -resize 50% -gravity center -crop 150x150+0+0 +repage _thumb.jpg

The rest like this (only with other resolutions, 2000 being the highest):
convert -resize 1000x1000 image.jpg image_1000px.jpg

Usually it works well, but after a while I see more and more convert processes running at the same time where there should be only one, because the script doesn't overlap itself. These processes even killed the server when suddenly more than 130 processes were running without quitting, but stuffed the server memory (which has 16 GB).

So is there a known problem which causes imagemagick to hang? I'm thankful for every help!
Post Reply