Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter\Database\Exceptions\DatabaseException Unable to connect to the database.
#1

Hi,

I recently installed Sentry on my CodeIgniter 4 application to track any exceptions.

I have noticed at random times normally 5AM GMT, my application is throwing the error.
CodeIgniter\Database\Exceptions\DatabaseException
Unable to connect to the database.
Main connection [MySQLi]: Too many connections


In Sentry it looks like it could be because at that time that's when BingBot crawls the website so there is significantly more traffic.

My database MariaDB is set to max connections 250, and I don't see why Codeigniter 4 would need anywhere near this amount is the case that I need to increase this limit?

The database connection is defined in the .env file with the following keys.

database.default.hostname = 
database.default.database = 
database.default.username = 
database.default.password = 
database.default.DBDriver = 
database.default.DBPrefix =
database.default.port = 3306


I'm using Codeigniter v4.4.3.

Any help or ideas to point me in the right direction would be appreciated, thanks.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB