Page 1 of 1

cpu overloading

Posted: 2012-03-07T14:01:12-07:00
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

Re: cpu overloading

Posted: 2012-03-07T14:47:16-07:00
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...).

Re: cpu overloading

Posted: 2012-03-07T14:58:26-07:00
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

Re: cpu overloading

Posted: 2012-03-08T02:28:48-07:00
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..

Re: cpu overloading

Posted: 2012-03-08T21:44:03-07:00
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.