简体   繁体   English

Image Magick:在Linux服务器上花费太多时间

[英]Image magick: takes too much time at linux server

I am facing an issue with time taken by imagemagic to execute the commands on my server. 我面临imagemagic在服务器上执行命令所花费的时间问题。 I also tried to make thread control from 20(default) to 1 but, no improvements. 我还尝试将线程控制从20(默认)设置为1,但是没有任何改进。

Here are some of the commands we fire and time took for them on server. 这是我们在服务器上触发并花费时间的一些命令。 Is there any way to reduce this execution time? 有什么办法可以减少执行时间?

  1. /usr/bin/convert source1.jpeg -resize 4518x3013! / usr / bin / convert source1.jpeg-调整大小4518x3013! output.png output.png

    real 0m13.150s user 0m18.320s sys 0m2.029s 真实0m13.150s用户0m18.320s sys 0m2.029s

  2. /usr/bin/convert output.png -crop 2408x3010+1053+0 +repage cropped.png / usr / bin / convert output.png -crop 2408x3010 + 1053 + 0 + repage cropped.png

    real 0m5.978s user 0m5.043s sys 0m0.881s 真正的0m5.978s用户0m5.043s sys 0m0.881s

  3. /usr/bin/convert destination.png -draw image over 564,564+2408+3010 'cropped.png' output.png / usr / bin / convert destination.png-在564,564 + 2408 + 3010'cropped.png'output.png上绘制图像

    real 0m10.085s user 0m11.160s sys 0m1.710s 真实的0m10.085s用户0m11.160s sys 0m1.710s


Updated Information 更新信息

identify -version command output: 标识-version命令输出:
Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-08-16 http://www.imagemagick.org 版本:ImageMagick 6.8.9-1 Q16 x86_64 2014-08-16 http://www.imagemagick.org
Copyright: Copyright ( c ) 1999-2014 ImageMagick Studio LLC 版权:版权所有(c)1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP 功能:DPC OpenMP
Delegates: bzlib freetype gslib jng jpeg png ps tiff zlib 代表:bzlib freetype gslib jng jpeg png ps tiff zlib

Server configuration: 服务器配置:
OS version is centos 6 操作系统版本是centos 6
RAM 32GB 内存32GB

source1.jpeg( link ) source1.jpeg( 链接
First command executed with -bench 5 and returned below output. 第一个命令由-bench 5执行,并在输出下方返回。
Performance[1]: 5i 0.095ips 1.000e 90.970u 0:52.550 性能[1]:5i 0.095ips 1.000e 90.970u 0:52.550
Performance[2]: 5i 0.104ips 0.522e 92.310u 0:48.110 性能[2]:5i 0.104ips 0.522e 92.310u 0:48.110
Performance[3]: 5i 0.090ips 0.485e 93.420u 0:55.770 性能[3]:5i 0.090ips 0.485e 93.420u 0:55.770
Performance[4]: 5i 0.086ips 0.474e 91.180u 0:58.230 性能[4]:5i 0.086ips 0.474e 91.180u 0:58.230
Performance[5]: 5i 0.091ips 0.488e 94.850u 0:55.030 性能[5]:5i 0.091ips 0.488e 94.850u 0:55.030

Thanks, Sagar 谢谢,萨加尔

Does this get you any faster? 这样会让您更快吗?

convert input.png -quality 80% -resize 4518x3013! \
    \( +clone -crop 2408x3010+1053+0 +repage \) \
    -geometry +564+564 -composite output.png

For really fast PNG writing, use -quality 10 for drawings, -quality 11 for photos. 要真正快速地编写PNG,请对图形使用-quality 10,对照片使用-quality 11。 This should cut your PNG-writing time by a factor of five. 这将使您的PNG编写时间减少了五倍。

The "quality" number doesn't affect image quality when writing a PNG. 编写PNG时,“质量”数字不会影响图像质量。 It only affects the compression effectiveness. 它仅影响压缩效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM