Hi Gang - I need some help with database connectio...
# lucee
g
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?
m
I don't know what I am talking about, but here are my thoughts. I don't know your exact scenario but it sounds like lucee is opening more connections then MySQL is set to accept with the infinite setting, maybe lower it to below the threshold that MariaDB is set to. And see if it cleans up and frees those connections...
a
What version of Lucee ?
g
5.3.10.97
Hi @Michael Schmidt I didn't even think of that...
I have managed to get it working by increasing the
max_connections
in AWS RDS. It defaults to sum algorithm that is based on DB server RAM or 12000, whichever is the lesser. • changed to 1000 and also the
wait_timeout
setting, too. which defaults to 8 hours - to clean up the unused connections. • changed to 300 (seconds)
a
If it’s that lucee version also worth looking at this
👍🏼 1