How increase the limits for database connections or optimize the frequency

I have a problem with the error_log file constantly filling up and I contacted the hosting support and they told me that I needed increase the limits for database connections or optimize the frequency

  • I see this message in err log  This message appears repeatedly but it stops. I want a solution to stop it permanently

    [08-Aug-2021 13:40:27 UTC] [2021-08-08 13:40:27] ELGG.ERROR: Exception at time 1628430027:
    PDOException: SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) in /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
    Stack trace:
    #0 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(27): PDO->__construct('mysql:host=loca...', 'toevpxgm_Databa...', 'Zizou.99', Array)
    #1 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(25): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'toevpxgm_Databa...', 'Zizou.99', Array)
    #2 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'toevpxgm_Databa...', 'Zizou.99', Array)
    #3 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1473): Doctrine\DBAL\Connection->connect()
    #4 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1109): Doctrine\DBAL\Connection->getWrappedConnection()
    #5 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(160): Doctrine\DBAL\Connection->exec('SET SESSION sql...')
    #6 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(127): Elgg\Database->connect('readwrite')
    #7 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(108): Elgg\Database->setupConnections()
    #8 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/Select.php(14): Elgg\Database->getConnection('read')
    #9 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/ConfigTable.php(154): Elgg\Database\Select::fromTable('config')
    #10 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/BootService.php(98): Elgg\Database\ConfigTable->getAll()
    #11 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(99): Elgg\BootService->boot(Object(Elgg\Di\ServiceProvider))
    #12 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(47): Elgg\Application\BootHandler->bootServices()
    #13 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(215): Elgg\Application\BootHandler->__invoke()
    #14 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(474): Elgg\Application->bootCore()
    #15 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(360): Elgg\Application->run()
    #16 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(416): Elgg\Application::route(Object(Elgg\Http\Request))
    #17 /home/toevpxgm/toevolution.com/index.php(8): Elgg\Application::index()
    #18 {main}
    
    Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) in /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31
    Stack trace:
    #0 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(25): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'toevpxgm_Databa...', 'Zizou.99', Array)
    #1 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'toevpxgm_Databa...', 'Zizou.99', Array)
    #2 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1473): Doctrine\DBAL\Connection->connect()
    #3 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1109): Doctrine\DBAL\Connection->getWrappedConnection()
    #4 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(160): Doctrine\DBAL\Connection->exec('SET SESSION sql...')
    #5 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(127): Elgg\Database->connect('readwrite')
    #6 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(108): Elgg\Database->setupConnections()
    #7 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/Select.php(14): Elgg\Database->getConnection('read')
    #8 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/ConfigTable.php(154): Elgg\Database\Select::fromTable('config')
    #9 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/BootService.php(98): Elgg\Database\ConfigTable->getAll()
    #10 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(99): Elgg\BootService->boot(Object(Elgg\Di\ServiceProvider))
    #11 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(47): Elgg\Application\BootHandler->bootServices()
    #12 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(215): Elgg\Application\BootHandler->__invoke()
    #13 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(474): Elgg\Application->bootCore()
    #14 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(360): Elgg\Application->run()
    #15 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(416): Elgg\Application::route(Object(Elgg\Http\Request))
    #16 /home/toevpxgm/toevolution.com/index.php(8): Elgg\Application::index()
    #17 {main}
    
    Next Doctrine\DBAL\Exception\DriverException: An exception occurred in driver: SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) in /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:110
    Stack trace:
    #0 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(172): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
    #1 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(159): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'An exception oc...')
    #2 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(28): Doctrine\DBAL\DBALException::driverException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException))
    #3 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'toevpxgm_Databa...', 'Zizou.99', Array)
    #4 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1473): Doctrine\DBAL\Connection->connect()
    #5 /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1109): Doctrine\DBAL\Connection->getWrappedConnection()
    #6 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(160): Doctrine\DBAL\Connection->exec('SET SESSION sql...')
    #7 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(127): Elgg\Database->connect('readwrite')
    #8 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php(108): Elgg\Database->setupConnections()
    #9 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/Select.php(14): Elgg\Database->getConnection('read')
    #10 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/ConfigTable.php(154): Elgg\Database\Select::fromTable('config')
    #11 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/BootService.php(98): Elgg\Database\ConfigTable->getAll()
    #12 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(99): Elgg\BootService->boot(Object(Elgg\Di\ServiceProvider))
    #13 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php(47): Elgg\Application\BootHandler->bootServices()
    #14 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(215): Elgg\Application\BootHandler->__invoke()
    #15 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(474): Elgg\Application->bootCore()
    #16 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(360): Elgg\Application->run()
    #17 /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php(416): Elgg\Application::route(Object(Elgg\Http\Request))
    #18 /home/toevpxgm/toevolution.com/index.php(8): Elgg\Application::index()
    #19 {main}
     {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred in driver: SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) at /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:110, Doctrine\\DBAL\\Driver\\PDOException(code: 1226): SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) at /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31, PDOException(code: 1226): SQLSTATE[42000] [1226] User 'toevpxgm_Database' has exceeded the 'max_user_connections' resource (current value: 30) at /home/toevpxgm/toevolution.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27)"} {"backtrace":["[#11] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database.php:108","[#10] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/Select.php:14","[#9] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Database/ConfigTable.php:154","[#8] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/BootService.php:98","[#7] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php:99","[#6] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application/BootHandler.php:47","[#5] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php:215","[#4] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php:474","[#3] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php:360","[#2] /home/toevpxgm/toevolution.com/vendor/elgg/elgg/engine/classes/Elgg/Application.php:416","[#1] /home/toevpxgm/toevolution.com/index.php:8"],"process_id":4103506,"memory_peak_usage":"2 MB","memory_usage":"2 MB","url":"/file/view/1751173/gt-america-font-download-free-fonts","ip":"87.150.72.139","http_method":"GET","server":"www.toevolution.com","referrer":null,"unique_id":"YQ-ey9TR8v3PC0wizMdkPgAAAU8"}
    
  • Nikolai Shcherbin Is there a solution to stop receiving this message until another host is found?

  • Where the error_log file is constantly full of errors, sometimes up to 1 GB

  • If you are on a shared hosting plan I don't think you have any way to change the MySQL configuration. So, you can't fix the problem on a shared server. You would need a VPS hosting plan where you could make changes in the my.cnf file to change the MySQL server configuration. CHOOSE YOUR HOSTING PLAN WISELY! I would urge you to choose a managed VPS hosting plan. This will cost more (certainly much more than a shared server hosting plan) but the administration of a VPS server is much more complex than a shared server hosting and I think you would be totally at a loss dealing with setting up everything on a VPS server on your own - and we certainly couldn't help you with everything!

    For the time being it MIGHT help (No promise!!!) to disable as much plugins as you can to reduce the number of simulatanious database connections. But if the max_connections value is very low it might not help even then. And if the connection_timeout value is too high (might be on a shared server) it might not even help with the lowest possible number of plugins in use.

  • I clearly see that I should upgrade because even after stopping a lot of add-ons, the problem still persists