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.
Performance problems
Re: Performance problems
Locate the policy.xml configuration file and set your thread limit to 2 (or 1):
- <policy domain="resource" name="thread" value="2"/>
Re: Performance problems
Oké, thanks I will try that and monitor it.
Re: Performance problems
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?
<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
Verify with
- convert -list resource