ImageMagick thumbnailImage Maximum Run Time 30 seconds

I use the ImageMagick function thumbnailImageto generate images. However, sometimes I get a message:

"The maximum execution time is 30 seconds exceeded."

One thing I noticed is that all bombs are up to 30 seconds. But the error indicated is still exceeding the maximum execution time.

The problem is much more like the link below. http://xenforo.com/community/threads/fatal-error-maximum-execution-time-exceeded-when-uploading-avatars.17982/

Can someone give some suggestion?

+5
source share
6 answers

, , 180 ( ). , , .

- ImageMagick , OpenMP. , OpenMP , . , .

, OpenMp ImageMagick.

, , , ( ): http://www.daniloaz.com/en/617/systems/high-cpu-load-when-converting-images-with-imagemagick/

: http://mapopa.blogspot.com/2011/10/php-image-slow-smp-magick-on-ubuntu.html . . :

apt-get build-dep imagemagick
+6

OpenMP ImageMagick, OpenMP - .

, Open MP,

identify -version 

OpenMP ""

, ImageMgick, OpenMP -.

ImageMagick MAGICK_THREAD_LIMIT 1 IM-.

putenv('MAGICK_THREAD_LIMIT=1');

: .

+2

set_time_limit.

0, script .

set_time_limit(0);

, , , , imagemagick .

, , imagemagick. - , . , script.

+1

, ImageMagick OpenMP, ImageMagick , PHP-FPM, , max_execution_time, php.ini, .

: convert -list resource Thread. 1.

1, ImageMagick policy.xml:

<policy domain="resource" name="thread" value="1"/>

: convert -list resource. 1.

PHP-FPM. : service php7.1-fpm restart, , PHP max_execution_time, .


, PHP. PHP:

Imagick::setResourceLimit(Imagick::RESOURCETYPE_THREAD, 1);
echo Imagick::getResourceLimit(Imagick::RESOURCETYPE_THREAD);

, Imagick ImageMagick 6.7.8 .


, ImageMagick , . , policy.xml max_execution_time : 30 * number_of_threads.

, , .

  • ImageMagick OpenMP.
  • mod_php PHP-FPM.
0

<?php set_time_limit(0); ?> PHP .

-1
source

All Articles