Search code examples
ubuntudebianimagemagickimagemagick-convert

Imagemagick convert uses heavily disk resources


on my local machine, I wrote a script that uses ImageMagick's convert many times. One of the most used commands is this:

convert -size 4200x5100 xc:blue sth.jpg

. On my local machine, it runs about 1s, which is OK. It does not use too many resources.

When I deployed the program to 2 different servers, they started to use the disk very powerfully and the same run took about 9 seconds instead of one.

I figured out that on the servers it creates a file (filename is like: /tmp/magick-30416RF1uGkxsk3ms) which is exactly 250.000.000 bytes big.

On the local machine, this file does not get created.

The versions are: local machine: laptop, Ubuntu 16.04, lenovo t440. IM / convert version: 6.8.9-9

Server1: debian 10.8, week fresh install, vps, IM / convert version: 6.9.10-23

Server2: physical machine, debian 9.6, IM / convert version: 6.9.7-4

.

My question is what can cause this huge difference between the local machine and the servers? How can I prevent ImageMagick to create this monster big temporary file?

Or is it a new feature in 6.9 versions??


Solution

  • I need to increase the value of area and/or map and/or memory in the /etc/ImageMagick-6/policy.xml file . It'll solve the issue.