Database connections exceeded

Hi guys, i got on multiple instances of OC v4 strange error, based on max connections to database. I knew, it is a thing of shared hosting policies etc, but, there is probably some leak or underlying problem inside octobercms, that not close connections correctly in some circumstances.

im not able to find correct problem, because i think it is PDO based… but, i think there is problem with dashboard that may be a performance problem.

Hey @snipi

This is almost certainly related to your database configuration.

i.e Too many requests VS not enough available database connections.

150 for standard website is quite enough, right?
not sure, how there even can be that much connections.
only heavy load requests i can track down was related to dashboard

1 Like

Same here. I’m running on the same host a heavy-loaded WP-instance without this issue. Only OCMS 4.2.x is throwing “max connections to database”

This is almost certainly not an OctoberCMS issue itself, and without being able to reproduce it we’d just be guessing at causes. You’ll need to dig on your end to find out what’s actually holding the connections open.

SHOW PROCESSLIST; while the error is happening is the best starting point - it’ll show you exactly which connections are stuck and where they’re coming from.

still trying to identify main reason that overhaul mysql connections… there may be multiple things, that can make multiple connections, but from main POV everything is routed via PDO, right? then there is from app a nice enclosing of any connections etc. but there may be some kind of raw queries outside. for example, how are handled logs? not just error logs that shows on backend errors, but all logs, access logs, traffic logs for new dashboard, etc etc.

when i disabled dashboard i was never reached that 150 connections limit ever.

1 Like

Please keep digging to find the answer. I wonder if it relates to the version of Laravel?