Hi Gang - I need some help with database connections, please.
We use AWS RDS (MariaDB)
I am using the MariaDB JDBC extension
I am using 5.3.10.97, Lucee.
RDS is set for MAX 250 connections.
ALL the datasources have the same settings.
"inf" connections
1 min idle timeout
5 min timeout.
I have two symptoms that I need some help with and I have no idea, if they're even connected to each other.
Doing some load testing, we managed to kill our application.
1.
The log filling with errors about the connection being refused by the "datasource", "Too many connections".
However RDS reports that we only ever open 150-ish.
And with the max connections in the (lucee) datasource, being set to "infinity" - I just don't understand the error.
2.
I run a jMeter test with 50 concurrent users (x 2 loops)
(I tried 2 different types of tests - only one of these at a time)
a. hit a REST API
b. hit the login URL and submit the form with a valid username / password
Further, I run this 3 times inside a minute.
AWS monitoring shows that I have 300 connections open.
(regardless of which jMeter test I am running API/Logjn)
I wouldn't expect it to behave this way.
When test run 1 completes - I would assume that the connections would now be idle.
I would also assume that the second run of jMeter, would use the, now, idle connections that were created as part of the first run.
But... it doesn't.
It goes and creates another 100 connections.
In fact I would have assumed that after the first loop of 50 - that the second iteration would have used the connections from the first iteration.
My thinking being that they should now be idle at this point.
Now even if I assume that jMeter is holding onto the connections - quitting jMeter doesn't clear the connections.
This morning, I logged back into the staging server that we are doing this testing on and there were still 40 connections open.
According to the AWS monitoring they have been "connected" since 2am - when I stopped trying to debug the issue. (it is now 930 am)
After it fell to 40 connections - it remained there, flat.
Even with 1 minute polling and 1 minute resolution in the monitoring - there wasn't a single change.
So I guess what I am after is:
How do "connections" work?