I launched a AWS RDS MySQL instance, which is currently only accessed by 2 identical instances of a Play!-Framework application. This application has some akka scripts running, which access the DB (f.e. checking for old/unreferenced entries). Further, the DB currently still holds a table with BLOB data fields, which will be partially be filled with end-user data. I therefore try to benchmark what instance size the application requires, especially estimating user actions involving small queries (logging in) but also large queries (uploading/downloading BLOBs).
However, after setting up the instance, the connection count metric provided by AWS shows strange behaviour:
Obviously an akka-script is running every ~15 minutes, pumping up the db connections up to 27. Most of the times the connections drop to 4 again for a couple of minutes, just to rise up again to 27. This leaves me puzzling about some questions:
- coming from .NET, I always engaged with DBs with USING, meaning that I connect to the DB, do my stuff there, disconnect and dispose the connection. So my DB connection would exist just for a couple of (milli)seconds, for the time of the query. Is this different in java/play? Or was it simply implemented poorly within the Play!App (which was not written by me)?
- why are my DB connections never 0? I understand that my 2 instances of the application might be hooked up permanently to the DB, but shouldn't this connection be pooled then? Right now it feels like every single query from the Play!App creates at least 2 new db connections.
- When I connect to the server via MySQL workbench, the connections jump from 27 to 29 (instead of 28). So maybe the db connections are simply not exactly accurate but maybe calculated through another metric (like freeable memory)?
- Should I be worried about this when scaling the RDS instance? If every user interaction uses a couple of db connections, I will hit a limit there quite soon (I did read about changing this value manually instead of having it calculated by AWS).
- Is there any way to see the current db connections in AWS/MySQL? Maybe this could help me finding out more about this issue...?