Page 1 of 1

Runaway convert commands

Posted: 2013-04-11T05:38:09-07:00
by juliecool
Are there any common reasons for runaway convert commands? A frequent problem on my server is the convert command that goes out of control, taking up 100% of the CPU and hosing everything. The only thing to do is kill the process.

It's always been a problem to some degree. Previously I wasn't doing anything esoteric, just thumbnailing GIFs and JPEGs for use online.

More recently we've been layering GIFs using various compose operators. Lately we are having a consistent problem with the Vivid_Light compose operator:

Code: Select all

/usr/bin/convert input.gif null: composite_input.gif -matte -dispose None -gravity center -compose Vivid_Light -layers composite output.gif
Seems normal right? Commands containing Vivid_Light have been going bonkers for two days now. Any ideas?
Also, any strategies to mitigate against runaway converts would be appreciated.

Version: ImageMagick 6.7.8-7 2013-03-10 Q64

Re: Runaway convert commands

Posted: 2013-04-11T06:53:18-07:00
by magick
We stop runaway jobs on our server by setting ImageMagick policies. For example 'time' automatically kills a job after this value expires:

Code: Select all

<policymap>
  <policy domain="resource" name="temporary-path" value="/tmp"/> 
  <policy domain="resource" name="memory" value="256MiB"/> 
  <policy domain="resource" name="map" value="512MiB"/> 
  <policy domain="resource" name="area" value="128MB"/> 
  <policy domain="resource" name="disk" value="1GiB"/> 
  <policy domain="resource" name="file" value="768"/> 
  <policy domain="resource" name="thread" value="2"/>
  <policy domain="resource" name="throttle" value="0"/> 
  <policy domain="resource" name="time" value="120"/> 
  <policy domain="system" name="precision" value="6"/> 
  <policy domain="cache" name="shared-secret" value="whatever"/>
</policymap>
You can add -debug cache to your command line to trace a job to see why it may be a runaway. For more details, see the ImageMagick architecture overview @ http://www.imagemagick.org/script/architecture.php. Upgrading to latest release of ImageMagick may help as well.

Re: Runaway convert commands

Posted: 2013-04-11T10:35:19-07:00
by pipe
juliecool wrote:Version: ImageMagick 6.7.8-7 2013-03-10 Q64
I'm just curious: When is a quantum depth of 64-bit needed or even remotely useful? I didn't even know it was supported.

Re: Runaway convert commands

Posted: 2013-04-11T12:29:19-07:00
by magick
Good catch. Reinstall ImageMagick and use Q16 rather than Q64. Q64 is experimental and is not supported.