Blur command in image magic make the server overloaded

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
solacedevelopers
Posts: 11
Joined: 2016-09-12T07:43:22-07:00
Authentication code: 1151

Blur command in image magic make the server overloaded

Post by solacedevelopers »

Hello :)
we are very happy to used image magick command to blur the image on our website.
But unfortunately we faced a problem of server load on site that displayed in shell please see in screenshot http://prntscr.com/ch4z6m
We have 12 core processor on server still it get fully loaded.
Also we used the blur image command only once and also confirmed that the command is not in any loop
still it shows repeatedly in shell please see in screenshot http://prntscr.com/ch51lg ,
So we are requesting you please suggest a solution about this for us.
Thank You.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Blur command in image magic make the server overloaded

Post by magick »

Have you read https://www.imagemagick.org/script/security-policy.php? Try reducing the number of threads. If that is not effective you can always introduce a throttle. However, throttling may not be needed. You have multiple instances of the 'convert' command. That likely comes from your web page or script. It is unlikely that ImageMagick would repeatedly generate the same command process.
solacedevelopers
Posts: 11
Joined: 2016-09-12T07:43:22-07:00
Authentication code: 1151

Re: Blur command in image magic make the server overloaded

Post by solacedevelopers »

Thanks for your quick reply. We will check and verify the details again at our end based on your comments. We will post the exact command and other details after that.
solacedevelopers
Posts: 11
Joined: 2016-09-12T07:43:22-07:00
Authentication code: 1151

Re: Blur command in image magic make the server overloaded

Post by solacedevelopers »

The link you given https://www.imagemagick.org/script/security-policy.php? is just a way to allocate the resource, actually problem is not that.
we are executing following command
<?php
$ext="png";
$command="convert ../../userUploads/129146/blur_source_image_60587.".$ext." -channel RGBA -blur 0x33.444444444444 ../../userUploads/129146/blured_image_60587.".$ext;
exec($command, $arr, $return_var);
?>
The script is of just 3 lines and i getting the no. of threads and command on my shell >> http://prnt.sc/cpzxye
the source image is 24MB with resolution is 4317X6135

On the other hand i open the source image on paint and save as jpg
now the size of image is 4MB with resolution is 4317X6135 and run the following command
<?php
$ext="jpg";
$command="convert ../../userUploads/129146/blur_source_image_60587.".$ext." -channel RGBA -blur 0x33.444444444444 ../../userUploads/129146/blured_image_60587.".$ext;
exec($command, $arr, $return_var);
?>
It works well with no repeatation of the command on shell.
Please tell me whats is the issue
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blur command in image magic make the server overloaded

Post by fmw42 »

What do you get from

Code: Select all

convert -version
Does it include png in the list of delegates? If so what is the version of libpng. You can find that at

Code: Select all

convert -list format
Have you checked for any errors in your PHP $arr?
solacedevelopers
Posts: 11
Joined: 2016-09-12T07:43:22-07:00
Authentication code: 1151

Re: Blur command in image magic make the server overloaded

Post by solacedevelopers »

Hello,
Thanks for your last reply. As per your last comment, I tried both of the above command and
it shows the following output >> http://prntscr.com/cqfwub
solacedevelopers
Posts: 11
Joined: 2016-09-12T07:43:22-07:00
Authentication code: 1151

Re: Blur command in image magic make the server overloaded

Post by solacedevelopers »

For more details please download this image file http://www.arttoframe.com/screenshot.png
Thanks again.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Blur command in image magic make the server overloaded

Post by snibgo »

I'm unclear what problem you are having, but v6.7.2-7 is very old, and an upgrade may resolve it.
snibgo's IM pages: im.snibgo.com
Post Reply