Constant 'Database Connection Faulted' errors in Gateway log

v7.9.10

I have these errors that I only just noticed, as far back as I can go in the Gateway Log viewer. How can I diagnose these and find what’s causing them?

What DB? How many connections allowed?

Sql server
Connections were set to default 8
Time out was set to default 5000ms

Any specific queries that stand out in the slow query log?

There haven’t been any faults since changing the config for 3 hours now, so this is possibly resolved in terms of the crashing.

These are from longest queries just now. Some seem overly long… INSERT shouldn’t take 51s to execute

Seems to me you want to ensure indices on event_timestamp and action_target.

FWIW I do not feel that the duration given in my Longest Recent Query list are accurate and do not pay them much mind.

I often see entries that list a query duration as 30 minutes and started 20 minutes ago, things like that. If the variables were listed in Named queries rather than just logging the “?” it would make troubleshooting easier. But as-is I cannot believe some of the times I see recorded there. I cannot come close to replicating them via spot checks.

Having a similar issue with my gateway, we've got a DB connection that faults like this at the exact same minute of every hour. Its associated app has many clients open at once so when the fault occurs the log gets up to 50 faults for the same database connection but from different session IDs. What exactly did you change about the database configuration to mitigate this issue?

That's a really good question, and I have no idea why I was so cryptic in my other reply...

That being said, what is the is the number of connections you're seeing on you db connection in the gw status page?

Thanks for helping out.
This particular DB has a maximum of 16 connections, and it usually floats between 5-12 being used at any given time.