1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Endless upload of GIF avatars

Discussion in 'Troubleshooting and Problems' started by LunarCraft, Jul 4, 2012.

  1. LunarCraft

    LunarCraft Member

    After installing Imagick and confirming that it works on my server, I am still unable to upload animated GIFs as avatars, it simply hangs and never times out.
    Server log contains no errors and I can use Imagick for static images, that works fine. But the moment it is an animated GIF, it locks itself in an endless loop of loading bars.

    I have made sure that internal_data and data is chmodded to 777.
    Is there anything in particular I should look for in order to solve my problem?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I have seen this before with some installations of ImageMagick. I don't know exactly what causes it. But I know that many people have fixed this problem by upgrading to the latest version of ImageMagick.
  3. LunarCraft

    LunarCraft Member

    Does this help deciding if my version could be wrong? It is a completely fresh install of Imagick on Debian 6.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  5. LunarCraft

    LunarCraft Member

    I updated the PHP imagick extension to 3.1.0RC2, that did not help.

    I uninstalled imagemagick (apt-get remove imagemagick) and downloaded the source and compiled it. When I do "convert -version" this pops up
    Version: ImageMagick 6.7.8-0 2012-07-05 Q16 http://www.imagemagick.org

    However, as in the screenshot above, the version displayed for Imagick is ImageMagick 6.6.0-4 2012-05-02 Q16 http://www.imagemagick.org

    Am I missing something?

    edit: I got it updated fine. Works now! Clue was to remove all the old packages, and do a fresh install of the latest ImageMagick.
  6. Markus

    Markus Member

    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
    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.

    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 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
    make install
    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.

    Attached Files:

    Jake Bunce likes this.
  7. Tracy Perry

    Tracy Perry Well-Known Member

    Are you running Wheezy and the dot.deb repository? Reason I ask is I'm running Debian and it takes just a few second for the upload and the conversion, and this is on both servers (I'm running dedicated dual L5520 servers).
    Current versions I'm using are
    Version: ImageMagick 6.7.7-10 2012-11-06 Q16 http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
    Features: OpenMP

    Module 3.1.0RC2
  8. Jeremy P

    Jeremy P Well-Known Member

    @Tracy Perry I'm using Wheezy and DotDeb, running exactly the same versions of ImageMagick and imagick as you, but no animated gif uploads ever complete for me.

    I just switched back to GD. Something about ImageMagick is causing problems.
  9. Tracy Perry

    Tracy Perry Well-Known Member

    Are you using Apache2, nginx or LightSpeed?
    I'm using nginx and wonder if it could be related to either the web server or your php5-fpm/php.ini settings (if you are using nginx).
  10. Jeremy P

    Jeremy P Well-Known Member

    nginx and php5-fpm, I would suspect so as well but haven't been able to trace it to anything particular.

    Thought it might be max_execution_time but even the smallest of gif uploads fail. Not sure what else it could be. I can upload 3mb jpegs fine.
  11. Tracy Perry

    Tracy Perry Well-Known Member

    I'm using these (think they are defaults) in my /fpm/php.ini. The nginx section below is the only thing I think I'm using that is not standard.

    max_execution_time = 30
    max_input_time = 60

    In my nginx.conf I have
    client_body_buffer_size 26K;
    client_header_buffer_size 1k;
    client_body_in_file_only clean;
    large_client_header_buffers 2 1k;
  12. Jeremy P

    Jeremy P Well-Known Member

    You know what, upping execution time did do the trick. Doing the actual upload takes no time at all, but processing the file with imagick seems to take a while. CPU spikes during it too, but it works.
    Tracy Perry likes this.
  13. Tracy Perry

    Tracy Perry Well-Known Member

    Yeah, i guess having dual 5520's on my system helps out on the processor time - not to mention that all it does is run one forum and munin. :p
    I'm kinda weird in some ways. I have identical dedicated servers, and each one is dedicated to just one forum (with the resources I have I could run them all on one). I replicate the DB and site structures between the two of them so that if one server goes down for any length of time all I have to do is change the IP in the DNS and be back up a short time later until the original server is repaired. One day I may work on figuring out how to set it up to automatically fall over but for me that's overkill right now.
  14. Jeremy P

    Jeremy P Well-Known Member

    The underlying hardware is actually 2 (hex-core) L5638s @ 2ghz, but I only have 2 of the 12 cores available in my virtual environment.

    Yeah, because that would be overkill :rolleyes::ROFLMAO:
  15. Tracy Perry

    Tracy Perry Well-Known Member

    Yeah, each one has all cores dedicated to it. I figured at a base price of $55 per server I could afford to do that instead of getting one larger server.
    ;) I guess you could say I'm already killing it several times over - but setting up fall over is more headache than I want to get into. Probably start looking at how to do it within the next month or so, but since my forums have low user counts (one has about 8 and the other 3) I'm not really that much in a hurry to do.
    Jeremy P likes this.
  16. Markus

    Markus Member

    I'm not exactly sure what you mean with the above question.

    My OS on my VPS is Debian 6.0 32bit and my PHP installation is PHP Version 5.3.3-7+squeeze15.

    When I tried to install the ImageMagick from repo (Version number was 6.6.* something), it had this OpenMP problem which caused really horrible image procession performance. Which would come up as a failing upload on my website.

    Anyway, what I wanted to share with my last post was the information that the OpenMP may cause a massive performance drop on those system, if the current version has the bug. So the first thing for people with non-uploading avatars is to check that this is not the cause for the problem. I suppose the next one is to check the that the dependencies for the required image format is installed as well and so on.

    When I installed and build the latest version of ImageGick with the basic "./configure", I was unable to upload any GIF avatars on my server. But when I reinstalled it without the OpenMP, it fixed the upload problem.
  17. Tracy Perry

    Tracy Perry Well-Known Member

    Debian 6.0 is Squeeze, Debian 7.0 (which is the latest) is Wheezy. So, if you had the latest version of Debian (7.0 Wheezy) and the dot.deb repository you would have more recent versions than what you get with Squeeze. My point was to inquire exactly what you indicated... you are running an older version of the OS along with mostly older versions of the modules (that ship by default).
    I'm running the shipping version on a Xeon dual L5520 server with all cores dedicated to the forum... so if OpenMP was going to cause a problem with multi-processor systems - you would think it would rare it's ugly head on mine in a heartbeat.
  18. Jeremy P

    Jeremy P Well-Known Member

    OpenMP issues still seem to be affecting Wheezy. I've just gone ahead and compiled ImageMagick from source disabling it and things seem noticeably faster.
  19. Tracy Perry

    Tracy Perry Well-Known Member

    I wonder if it could be something to do with the processors then, as with my L5520's I have no problems (and I ran several tests last night to try and break it). I uploaded about 20 110-120kb .gif files for avatars and after about 3 seconds they were there and 1 3.1mb one (took a little longer to upload) and it worked fine also.
    By chance are you using Ruby on Rails? I've also read that OpenMP could cause issues in a virtualized environment (a VPS), which could explain why I'm not having the problems with it.
    Last edited: Jun 24, 2013
  20. Jeremy P

    Jeremy P Well-Known Member

    Not using Rails, could be the virtual environment. Also it works (even with OpenMP problems) it just causes terrible performance (CPU spikes).

Share This Page