search
Homephp教程php手册解決 imagick 在 多线程运行时导致CPU暴增到100%的方法,解決imagick

解決 imagick 在 多线程运行时导致CPU暴增到100%的方法,解決imagick

假如把imagic 安装到 /usr/local/imagemagick 目录

首先用/usr/local/imagemagick/bin/convert -version指令查看一下输出內容是否已经开启了多线程,Features:的值为空或DPC 说明是单线程,如果Features:的值是openMP说明是多线程.imagick的多线程模式有一個bug,他会导致多核心的cpu使用率瞬间飙升到100%.所以一定要使用它的单线程程模式才行.

 上边是我配置正确时显示的结果,如果沒有配置正确会显示下边的结果

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

 第一种结果是单线程模式,第二种结果是多线程模式,因为imagick的多线程模式有bug,所以如果您刚开始是用多线程模式安裝的imagick那就必须要yum remove imagemagick將其卸载掉重新安裝才行.

只需在安装时加入下面的红色字体部分就可以

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

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!