Imagick - Memory issue

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Other

bnsupport ID: 46fc33b7-136f-e8e0-5422-25568d4c58ea

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/
https://docs.bitnami.com/installer/faq/linux-faq/administration/increase-memory-linux/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
Hi,

As mentioned here (LAMP-stack, imagick and webp) i got Imagick and webp up and running, but there seem to be a memory issue.

Because when i enable it, the memory keeps increasing until it hist 100% and the server becomes unresponsive. If i disable the imagick extension in php again, there is no memory issue.

Hi @meldgaard

Thanks for using Bitnami LAMP!

I would like to know a little bit more about your context. What are you using Imagick for? Are you trying to process large images?

Additionally, I have been briefly reviewing your configuration. You have configured PHP to write out error logs to a file in your system. This file will presumably contain relevant information on the issue, could you please share its content?

You can do that by executing:

$ sudo tail -n 40 /opt/bitnami/apache/htdocs/logs/php.log

Let’s try to shed some light on the matter :slightly_smiling_face:

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Hi @jcarmona

Im using imagick to enable Webp images on the server, since GD isn’t compiled with Webp support, i need to use Imagick.

The only errors in there is reference to when i was setting up New Relic, so only errors is from when it couldn’t find the newrelic.so extensions for at short periode, but it’s not related to our memory issue.

Hi again @meldgaard

Im using imagick to enable Webp images on the server, since GD isn’t compiled with Webp support, i need to use Imagick.

I have launched a new Bitnami LAMP stack (7.4.24-5) and installed Wordpress on it in order to reproduce your problem.

Nevertheless, it seems GD does support WebP format by default. Moreover, I could successfully create a post with a webp image on it, and even apply some filters. Regarding RAM consumption, here are the figures for this set up:

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3697         497        2534          28         665        2947
Swap:             0           0           0

Maybe if you are running an older version of the stack, an easy possibility to solve your problems would be migrating to the latest one. Here you have a documentation guide on the matter just in case:

https://docs.bitnami.com/aws/how-to/migrate-wordpress/


Having said that, I have also tried enabling the imagick PHP extension and see how the instance behaves. WordPress does successfully recognize it (and the formats):

I created another post with WebP images and applied some filters again. RAM consumption did not dramatically increase:

              total        used        free      shared  buff/cache   available
Mem:           3697         642        2393          28         661        2803
Swap:             0           0           0

Besides, Imagick has configured some caps in order to limit resource consumption (you can see them in the image). Could you check what are those limits set to in your instance?

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.