首页 > 解决方案 > Docker PHP API causing 100% CPU Usage on Elastic Beanstalk

问题描述

We have a PHP API that is running on Elastic Beanstalk.

Originally, we were just uploading the .zip file to an environment running "PHP 7.3 running on 64bit Amazon Linux/2.9.8". This worked fine and would load balance & scale as expected.

We just switched over to an environment running "Docker running on 64bit Amazon Linux 2/3.1.2".

When running our Docker environment, we see that the instances are getting error messages saying "CPU 100%". When this happens, we see our database connections getting stuck in a "Clean Up" state for way longer than normal (20+ seconds). This causes our database to start refusing connections because there are too many connections.

If we switch back to our original setup, everything is fine.

So my question is: Does anyone know what settings / configuration with a Docker environment that could cause this behavior?

Thanks in advance for any information!

标签: phpamazon-web-servicesdockeramazon-elastic-beanstalk

解决方案


推荐阅读