On 6/21/21 14:54, Jerry Malcolm wrote:
I have a TC instance running on an EC2 in an AWS Autoscaling group.  I have a database with 500 max connections.  The default EC2 count is 2 instances in the autoscaling group.  I guess that means that I should set the Tomcat resource config for this datasource to be maxTotal = 250, so if both instances max out we never exceed the 500 db max.  But sooner or later, the auto-scaling group is going to add a third and maybe a fourth instance at some crunch time, all still talking to the same database.  Now we have a maxTotal combined of 1000 connections talking to a database that can handle 500 which seems to be a recipe for disaster.  Yet I want to utilize all 500 available connections when I have one two EC2 instances running.

Is there something I can do inside TC to rebalance the maxTotal connections available to each TC instance as instances are added and removed?

Other suggestions?

You may be surprised at how few connections per node you can get away with. At $work, we usually have ~500 users per Tomcat node and they are each sharing a connection pool with maxTotal=20. Maybe you need more, but you might want to "work forward" from what you actually need on each node, rather than "working backward" from your database's limits.


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to