I have a PHP application deployed on AWS Elastic Beanstack with ELB attached to it. When there is huge traffic I'm getting ELB 5XX/4XX errors. So from the below error, I found that the application has memory limit issues. I have increased the memory limit to -1. And sent huge traffic to different endpoints using Jmeter. I don't see any errors now. But I'm not sure whether the application using memory_limit -1 or not. any suggestions to test?
Error:
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 32 bytes) in /var/app/current/XXXXX/XXXXX/AAAAAA.inc on line 222
Solution:
Added a file inside .ebexstentions
to change the memory limit to -1
file: /etc/php.d/memorylimit.ini
,
mode: 000755
owner: root
group: root
content:
memory_limit=-1