Page 1 of 1

Performance problems

Posted: 2011-11-09T04:24:28-07:00
by bigeagle
Last week I've introduced Imagemagic in our CMS to reduce the images. Works pretty good and the images have a higher quality then reducing images with PHP GD and the're small too!

But one problem is the performance of ImageMagic. When I reduce for example 10 images after each other with ImageMagic (users have the possibilty to upload multiple images at once ) the load of my server is growning fast and I see 4 a 5 convert processes in linux TOP. Sometimes the load is growing to 8 and thats very high for a quad core machine, With PHP GD I had not that problem.

Some info:
Version: ImageMagick 6.7.3-2 2011-10-25 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

OS is CentOS and I use ImageMagic with PHP.

Re: Performance problems

Posted: 2011-11-09T05:27:08-07:00
by magick
Locate the policy.xml configuration file and set your thread limit to 2 (or 1):
  • <policy domain="resource" name="thread" value="2"/>
You can also reduce the memory, for example, set it to say 60MiB.

Re: Performance problems

Posted: 2011-11-09T06:06:50-07:00
by bigeagle
Oké, thanks I will try that and monitor it.

Re: Performance problems

Posted: 2011-11-09T08:24:23-07:00
by bigeagle
Oké, I've uncomment that line:

<policymap>
<!-- <policy domain="system" name="precision" value="6"/> -->
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
<!-- <policy domain="resource" name="area" value="1gb"/> -->
<!-- <policy domain="resource" name="disk" value="16eb"/> -->
<!-- <policy domain="resource" name="file" value="768"/> -->
<policy domain="resource" name="thread" value="1"/>
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
</policymap>

Must I reconfigure something or is it correct now?

Re: Performance problems

Posted: 2011-11-09T10:58:26-07:00
by magick
Verify with
  • convert -list resource
It should show threads as '1'.