I had a use case of handling 100000 requests per minute & each request consists of 2 MySQL queries. Problem is that the server is able to handle the request(confirmed through the https logs) but unable to process it due to "Too many connections error".
Questions:
- If all these requests happen at the same time, will laravel make each connection to MySQL for each request & will terminate the connection(s) only after 2 those queries are being executed?
- If laravel does only one connection with MySQL, will laravel execute all those queries(100000*2) one by one (or) do concurrent executions?
- If yes for Question 1, should I increase the "Max user connections" for MySQL & increase the necessary hardware (or) Should I contact DB admin?
- Is "Internal Dummy Connection" has to do anything with this error since there are around 10000 requests happening per minute(Seen in HTTP logs)?
- How to handle this error? (I tried to restart MySQL process alone but I am unable to connect to the server when this error occurred & it is not coming back to the normal state until I restart the whole server)
I am currently struct with this situation, If anyone has an idea about one of these questions alone, Please answer so that it can be a head's up for the remaining ones. Since I am a developer, It will be the last option to go with paid AWS support.