Search code examples
scalaconnectionconnection-poolingrds

RDS connections queue size strategy


I'm connected to an RDS instance t1.micro which accepts at most 34 connections. There are some libraries, like https://github.com/seratch/scalikejdbc-async, which allow enqueueing of requests so that all of them will eventually be run (assuming they don't time out).

My question is, what is a good strategy to have for the maximum number of connections and the maximum queue size, i.e., is 33 the maximum number of connections and 99 the maximum queue size good enough?

Thank you!


Solution

  • There isn't a single solution for that. What you should do is to start experimenting and see how your application behaves under normal usage. Define a size for the queue, start working on it, measuring latency, contention and errors. Eventually you will find a good number to your app.

    One thing I've heard once from a Netflix guy is that queues will always be clogged and they won't move anywhere. So you must also decide when it's time to give up trying and and just fail.