convert hangs and kills the server
Posted: 2010-05-01T09:34:07-07:00
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!
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!