cpu overloading

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
okliv
Posts: 3
Joined: 2012-03-07T13:51:51-07:00
Authentication code: 8675308

cpu overloading

Post by okliv »

hi!

i have

Version: ImageMagick 6.7.5-3 2012-02-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

installed

my linux is gentoo (i've compiled from source)

when i call convert image.jpg -scale 50% image-small.jpg everything goes ok but
when i call convert image.jpg -resize 64x64 image-small.jpg all my server cpus jump up to 100% and this process take upto 10 seconds

is something wrong with imagemagick/server or it has to be like i described?

thanx in advance
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: cpu overloading

Post by magick »

Add --disable-openmp to your configure script command line and rebuild / reinstall ImageMagick. Also add -define jpeg:size=64x64 to your convert command line (e.g. convert -define jpeg:size=64x64 image.jpg -resize 64x64...).
okliv
Posts: 3
Joined: 2012-03-07T13:51:51-07:00
Authentication code: 8675308

Re: cpu overloading

Post by okliv »

in fact, i've got this results because of small investigation why server hang during picture uploading with carrierwave+rmagick gems for my ruby on rails app...
in this case i do not know how to add -define jpeg:size=64x64 to rmagick incapsulated commands... is it only one possible solution, or is it only an assumption?

thanx again for quick answer
okliv
Posts: 3
Joined: 2012-03-07T13:51:51-07:00
Authentication code: 8675308

Re: cpu overloading

Post by okliv »

i reinstalled imagemagick several times with --disable-openmp key, but no luck
then i uninstalled imagemagick first and made configure/make/install again and it works now!
openmp - is evil..
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: cpu overloading

Post by anthony »

okliv wrote:openmp - is evil..
It is a 'good' evil... in moderation... as it is with most things evil (like broccoli :lol: ).
But if you let the evil gather in large groups it starts to warp the universe in very unexpected ways.

On its own openmp is a good idea. But only if you don't use it with other openmp processes, or even a large number of other cpu bound processes. It is not for example a good idea to have it enabled for web servers, which can run a single PHP script, many many times in parallel.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply