However, here the CPU usage only went up to 150–180%, according to top and docker stats. The new system was unused while running the test script, so it also had plenty of CPU/memory available. While running the test script, its CPU usage went to >300% (according to top). The old system was in use while running the test script, but it had plenty of CPU/memory available. Therefore, I wouldn’t expect this resizing to be slower than before.ĭoes anyone have an idea what could cause this, and more importantly, how the performance can be improved in the new system? System usage Both systems use the same type of EC2 instances, and no explicit resource limitations are setup for the Docker container in the new system. In other words, the PHP 7.4 setup is 6 times slower than the old PHP 5.5 setup! (The times were measured from within the PHP script, so nginx/php-fpm shouldn’t have played a role.)įor other kinds of requests, the new setup if performing fine (slightly faster than the old one, as may be expected from PHP 7). New system (PHP 7.4 in Docker): 14.8 seconds average.Old system (PHP 5.5): 2.5 seconds average.I’ve run this script 5 times on the old and new system (through nginx with php-fpm), and found the following average execution times: $image->setInterlaceScheme(Imagick::INTERLACE_JPEG) įrom my measurements, it seems that the resizeImage() and getImageBlob() calls take the majority of execution time, as expected. $image->setImageCompressionQuality($image_quality) $image->resizeImage($image_size, $image_size, Imagick::FILTER_LANCZOS, 1, true) To diagnose the issue, I’ve made the following simple script, with a 5MB JPEG as input: readImage($image_name) The performance for image resizing using ImageMagick has decreased a lot. I’m upgrading some system from PHP 5.5 (installed directly on AWS EC2), to PHP 7.4 in Docker (running on AWS EC2 using Docker Compose).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |