Oct 21, 2018
0
Level 1
How to avoid PDOException: SQLSTATE[HY000] [1040] Too many connections
I have an API server built with lumen. When I run load test that swarms the server, at a certain points it throws PDOException: SQLSTATE[HY000] [1040] Too many connections. I am using a free tier AWS EC2 and RDS setup, but is there any way to optimize this without upgrading the RDS instance first?
My question is:
- Will connection pooling avoid this problem? Will the requests wait for an available connection instead of crashing when I use connection pooling?
Please or to participate in this conversation.