Why the database connection would be FAULTED periodically?

Hey guys:
I have a Gateway Script Timer which is executed per minute to do a query from my database,
while recently I found that the database connection woule be faulted every serveral minutes:

And it seems that the disconnection only lasted a quite short period until the next disconnection which is quite confusing.

The detail of the error is :

I’ve adjust some settings of the database connection due to the error but it doesn’t work.

I really need your help guys!!!

Check on the ignition status page how many connections you’re seeing connected to the database. If it gets to 8 or close to, increase your Max connections number. I don’t know if this is your issue, but definitely good to check at least. Any errors in your wrapper log or in your gatewua logs?

1 Like

Your database has logs too - probably worth looking at least for the time stamps directly prior to your gateway timeout.

1 Like

There’s a “Connection Refused” error as the ultimate cause. That means your setting of 8 connections is more than your DB allows. Consider other (non-Ignition) connections to your DB when configuring the DB’s own limits.


So I was right track, wrong direction haha

Hello Phill:
I notice that my colleagues have configure mysql events executed periodically, is the executions some sort of connections?
I think the error may have certain relation with these timed tasks.
image image
Under this circumstance, should I increase the max active/idle of decrease them?

Thank you very much for your suggestion Nick!

Yes I think it’s important cause some timed tasks might have relationship with the error

I would think so, but I am not a MySQL expert (I avoid it, actually). I would recommend increasing the allowed connections on the DB side, leaving Ignition's settings alone. It is also possible that this external operation is bogging down your MySQL instance. In that case, you will probably need a more powerful DB setup.

Thanks Phil!!