Solve the problem that imagick causes a CPU spike to 100% during multi-thread running.

Source: Internet
Author: User
: This article mainly introduces how to determine that imagick causes a CPU spike to 100% during multi-thread running. if you are interested in PHP tutorials, refer to it. If you install imagic in the/usr/local/imagemagick Directory

First, run the/usr/local/imagemagick/bin/convert-version command to check whether multithreading has been enabled for the output content. if the Features: value is null or the DPC indicates a single thread, if Features: the value is openMP, it indicates multithreading. the multi-thread mode of imagick has a bug, which causes the cpu usage of multiple cores to soar to 100% instantly. therefore, you must use its single-thread mode.

The above is the result displayed when I configured it correctly. If no configuration is correct, the following result is displayed.

Version: ImageMagick 6.8.9-10 Q16 x86_64 2015-12-28 http://www.imagemagick.org

Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC

Features: openMP

The first result is the single-thread mode, and the second result is the multi-thread mode, because the multi-thread mode of imagick has bugs, therefore, if you are using the multi-threaded imagick mode at the beginning, yum remove imagemagick must be used to uninstall it and re-install it.

You only need to add the following red font to the installation.

./Configure -- prefix =/usr/local/imagemagick -- disable-openmp

The above describes how to determine how imagick causes a CPU spike to 100% during multi-thread running, including some content, and hope to help friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.