CommunicationsException causing Mirth slowdown requiring Mirth restart #5834
Replies: 4 comments 3 replies
-
I would stop creating a connection every time. And create a shared dbConn in the globalMap as a first step. But any other errors in the DB log? |
Beta Was this translation helpful? Give feedback.
-
Are you still closing the connections when errors occur? Are you connecting to the mirth backend db or some other db? |
Beta Was this translation helpful? Give feedback.
-
@pacmano1, no other errors, just this one, and it happens anywhere from 4 to 12 times a day, usually in the mornings. @tonygermano, we are contacting our own database, although in the same server as the mirth ones. I just wasn't sure if this error was known to happen WITHOUT a connection pool. I'm not sure I'd trust a shared connection like in your example. Does mirth process everything single threaded? We have multiple inbound channels. I think we just need to start using a connection pool. |
Beta Was this translation helpful? Give feedback.
-
So "globalMap" is per channel, or would it need to be stored elsewhere for a per-channel connection? [edit] Oh, and we are not in the millions, but around 1k per hour. |
Beta Was this translation helpful? Give feedback.
-
We sometimes get "com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure" from a connection we got from DatabaseConnectionFactory.createDatabaseConnection(). When that happens a few times, Mirth sometimes starts to get slow, and we have to restart it to recover from the backlog. The log shows that it is happening on our script code, not in Mirth code.
The next line in the exception either says something like this:
... or this:
From what I read, people say this means that you have a bad connection in the connection pool, and you should add a validationQuery to your pool configuration, but as far as I can tell, we don't HAVE a connection pool. We call createDatabaseConnection() every time. DatabaseConnectionFactory seems to be a pretty thin wrapper over a DatabaseConnection, so I don't really get what is happening here.
What I THINK is going on here is that the exception in our script isn't really the problem, it is just showing us that there IS a problem. However, mirth.log doesn't show that any exceptions are happening there. I just don't see how a few exceptions in our script can cause our server to run slower. In fact, there is NOTHING in mirth.log but our exceptions and a few startup and shutdown messages. There isn't some secret mirth log somewhere other than /logs, is there? :-)
Any ideas? I'll probably try to switch to using a connection pool, but I just don't see what could be causing a slowdown here.
I don't KNOW that these exceptions are the cause of (or a symptom of) the slowdown, but we don't get a backlog unless we have these exceptions, although we don't always get a backlog if we see these exceptions.
Beta Was this translation helpful? Give feedback.
All reactions