This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Imagemagick causes high server load,...
expandshrink

Imagemagick causes high server load, when opening gallery

Imagemagick causes high server load, when opening gallery

Friday 17 August 2012 4:57:49 pm - 1 reply

http://www.imagemagick.org/script/architecture.php

"In most circumstances, the default number of threads is set to the number of processor cores on your system for optimal performance. However, if your system is hyperthreaded or if you are running on a virtual host and only a subset of the processors are available to your server instance, you might get an increase in performance by setting the thread policy or the MAGICK_THREAD_LIMIT environment variable. For example, your virtual host has 8 processors but only 2 are assigned to your server instance. The default of 8 threads can cause severe performance problems. "

I have VDS with 1 dedicated CPU, o n Server which has 12 CPU. This causes, that imagemagic starts 12 threads. In my case conversion of single image alias took 32 seconds. And with  MAGICK_THREAD_LIMIT = 1 it took only 0.07 second.

My solution (workaround) was to put 

putenv("MAGICK_THREAD_LIMIT=1"blunk.gif Emoticon;

to the beginning of config.php.

Has any other better solution?

Sunday 19 August 2012 10:25:32 pm

On VPS/VDS servers ImageMagick often runs into problems if it is installed through package management, because by default it has OpenMP enabled. OpenMP is known to cause exactly the type of issue you describe on virtual servers.

The solution is to compile and install from source using the --disable-openmp configuration flag. If the problems persist, you can also add the --without-threads flag.

See the following page for detailed instructions:

http://www.imagemagick.org/script/advanced-unix-installation.php

Hint: remember to run ldconfig after installing from source.

Also make sure you specify flags for all the file types you will be using. The ./configure command will list the file support to be installed and warn of missing prerequisites, such as libpng.

Example configure command:

./configure --disable-openmp --without-threads --with-jpeg --with-png --with-freetype

Modified on Sunday 26 August 2012 12:40:12 pm by Daniel A. Øien

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from