Hi, i saw other topics that state that Cloudflare isn’t involved with database connections. I keep receiving “error establishing database connection” messages - and they are resolved when i pause Cloudflare or change my nameservers back to default. When I got in touch with my hosting company regarding this, they responded with the following and I just want to make sure if you know what could be causing these sleeping queries?
There were 5 sleeping queries that were shown (a sleeping query is just a connection to MySQL that has not closed after the MySQL query has completed). When 10 concurrent database connections are made no additional connections to the database can be made as the concurrent database connection limit on our shared server environment is 10. When a MySQL connection is attempted and there are already 10 concurrent MySQL connections made to this database, this will result in the “Error establishing a database connection”. Once these connections have cleared and there are available MySQL slots, the connection will be successful.
I would suggest trying to clarify which part of the website/code is causing these sleeping queries to be generated upon logging into the WordPress admin panel as these queries occupy MySQL database slots for the database your website is connecting to. Cloudflare is used to improve websites security and performance and in turn should have not influence the amount of MySQL connections that are made to the database.