Limit CPU Usage of ImageMagick

Justin M 5 years ago updated 4 years ago 3

I'm having a problem when ImageMagick generates thumbnails, it is using 100% of the CPU. 

Image 85

If anyone else is browsing the site while the convert threads are running, they receive errors as the CPU is maxed out.

Image 86

I first installed Filerun on a 1 CPU Core, 2GB RAM Linode instance. I've since upgraded to a 2 CPU Core, 4GB RAM instance. But it still maxes out whatever CPU is available.

After a bit of searching, I tried setting Environment Variables as described here. I tried setting MAGICK_THREAD_LIMIT and MAGICK_THROTTLE_LIMIT in /etc/environment, but it doesn't seem to make a difference for me.

How can I limit the CPU usage of ImageMagick?

Does anyone else have this problem? Any solutions?


The employed solution was to upgrade ImageMagick to version 7.0.7-22 which apparently fixed the problem.

Hello Vlad R

I had the similar issue where Imagemagick threads take high CPU.. I have tried to upgrade the version to 7.0 and when i run my code to resize the image it is failing to do that. 

Do we need to update IM4Java files as well ?