I believe this was a pure error in
ImageMagick (and still is).
I have spend the last two days for getting animated avatars to work on my Debian server with the latest version of Xenforo and ImageMagick. The first and only issue that I had was the fact that uploading animated or pretty much any avatar when "
imagick PECL extension" was enabled, resulted in an infinite uploading.
Error log would have this to say about it
Code:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/library/XenForo/Image/ImageMagick/Pecl.php on line 267
The reason why this happens is because a bug in feature called "openmp". The bug causes dropped performance of 1000 times to more, spiking the CPU usage of the server to 100% resulting a few millisecond action of image to take several minutes or hours.
To fix this you can either get a downgraded version of ImageMagick where this bug was not yet introduced, compile the source with option "--disable-openmp" or force ImageMagick to use only one thread in the system with some environment + php variable definitions.
You can find more information from here ->
http://www.daniloaz.com/en/617/systems/high-cpu-load-when-converting-images-with-imagemagick/
I pretty much fixed this with the following command line.
Code:
apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd ImageMagick-6.8.6-*
./configure --disable-openmp
make
make install
ldconfig /usr/local/lib
wget http://pecl.php.net/get/imagick-3.1.0RC2.tgz
tar -xvvzf imagick-3.1.0RC2.tgz
cd imagick-3.1.0RC2
phpize
./configure
make
make install
ldconfig
Do note that I am a total Debian / Unix noob, so if you are on a same level as I am you might have to play around with the commands. The most important part is to compile the code with option "--disable-openmp" in order to fix / counter this bug. Rest of the job is to get your server and PHP to work with the software that you just built.
Remember to restart / reload your webservice after installation in order for the changes to be put in use.