Large number of Sleep connections to database in TYPO3

453 Views Asked by At

Our TYPO3 application is experiencing downtime issues, with the logs displaying the error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: An exception occured in driver: Too many connections

If I connect to the MySQL database and run SHOW PROCESSLIST, all I see are lots of connections with the command “Sleep”. This seems like a red flag to me but this is not my area of expertise; is there a good reason for this and if not what might the fix be?

1

There are 1 best solutions below

4
On

the PHP mysqli Driver allows for Persistent connections.

which basically means a connection is kept open and put to "sleep" till needed again.

this is a tradeoff: an already open connection does not need to be re-establisched so you can query faster. but at the cost that both systems spend some resources (Memory, CPU) on keeping the connection alive.

see the PHP documentation for more details: https://www.php.net/manual/de/mysqli.persistconns.php

and configuration options (php.ini) https://www.php.net/manual/de/mysqli.configuration.php