Page 1 of 1

Time limit variable

Posted: 2014-10-01T02:06:48-07:00
by Eriken
Hello.

In the policy.xml file one can set the <policy domain="resource" name="time" value="3600"/>. Accoring to documentation(http://www.imagemagick.org/script/resources.php) this variable holds the number of seconds each IM process can take before it`s aborted. In our production system this was changed from nothing(i.e commented out) to "120" which resulted in numerous aborted jobs. We use a python wrapper for IM called Wand(http://docs.wand-py.org/en/latest/) I suspect the variable is actually interpreted as milliseconds and not seconds, as when we commented out the policy the problem disappeared. Can you confirm the variable is interpreted as seconds and not milliseonds. If so this might be a bug in the wrapper..

Regards Erik

[edit]
The problem was that IM aborted it`s constrctor
"python: time limit exceeded `' @ fatal/cache.c/GetImagePixelCache/2098."
It aborted after stalling for less then a second. I don`t have the exact time for the IM constrctor. But with fetching files over http and parsing some json most images where processed at around 0.4 seconds. This makes it quite plausible too belive that many files passed as long as they where processed in under 120 ms, but where aborted if they took longer. Most of these images where light, mostly JPEGs and PNGs.
[/edit]

Re: Time limit variable

Posted: 2014-10-01T03:23:47-07:00
by magick
The time resource in policy.xml is in seconds. We verified it against the source code in ImageMagick.

Re: Time limit variable

Posted: 2014-10-01T03:34:14-07:00
by Eriken
Thanks for the swift response. Is it plausible that the wrapper uses this variable directly and somehow warps the conversion to milliseconds?

Re: Time limit variable

Posted: 2014-10-01T03:55:07-07:00
by dlemstra
What is your operating system and your IM version?

Re: Time limit variable

Posted: 2014-10-01T06:13:12-07:00
by Eriken
The server runs Ubuntu 12.04.2 LTS and has IM Version: 6.6.9-7.
The Python wrapper Wand, is version 0.3.7. Python 2.7.3.
See edit of first post for more info.

Re: Time limit variable

Posted: 2014-10-01T06:54:23-07:00
by dlemstra
That version of ImageMagick is more then 3 years old ('ancient'). Can you upgrade to the latest version and try again?

Re: Time limit variable

Posted: 2014-10-01T06:56:47-07:00
by Eriken
Might be due to availability og precise packages for 12.04 TLS, but thanks for the tips.