Time limit variable

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Eriken
Posts: 4
Joined: 2014-10-01T01:57:29-07:00
Authentication code: 6789

Time limit variable

Post 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]
Last edited by Eriken on 2014-10-01T06:22:32-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Time limit variable

Post by magick »

The time resource in policy.xml is in seconds. We verified it against the source code in ImageMagick.
Eriken
Posts: 4
Joined: 2014-10-01T01:57:29-07:00
Authentication code: 6789

Re: Time limit variable

Post by Eriken »

Thanks for the swift response. Is it plausible that the wrapper uses this variable directly and somehow warps the conversion to milliseconds?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Time limit variable

Post by dlemstra »

What is your operating system and your IM version?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Eriken
Posts: 4
Joined: 2014-10-01T01:57:29-07:00
Authentication code: 6789

Re: Time limit variable

Post 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.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Time limit variable

Post by dlemstra »

That version of ImageMagick is more then 3 years old ('ancient'). Can you upgrade to the latest version and try again?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Eriken
Posts: 4
Joined: 2014-10-01T01:57:29-07:00
Authentication code: 6789

Re: Time limit variable

Post by Eriken »

Might be due to availability og precise packages for 12.04 TLS, but thanks for the tips.
Post Reply