rendyt's avatar

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:

  1. Will connection pooling avoid this problem? Will the requests wait for an available connection instead of crashing when I use connection pooling?
0 likes
0 replies

Please or to participate in this conversation.