On 14/08/2019 23:35, Jerry Malcolm wrote: > On 8/14/2019 5:26 PM, Mark Thomas wrote: >> On 14/08/2019 23:09, Jerry Malcolm wrote: >>> In my previous environment, I had a dedicated MySQL install where I >>> could set the max connections to pretty much anything I wanted. Now I'm >>> moving to AWS where more connections mean a higher charge. So it's time >>> to get real about how many connections I really need. BTW, TC 8.5.xx. >>> >>> I 'thought' I understood defining a datasource. I thought that if I set >>> a maxTotal of 25 it sets a fixed ceiling and the datasource pool would >>> never request more than 25 connections from the database. But with the >>> following datasource definition, mySQL shows 48 connections created., >>> and JConsole shows 48 connections for this datasource. In the same >>> MBean panel, it shows maxTotal=25 (??). My app gets a bunch of "Server >>> says Too Many Connections" exceptions. >>> >>> What am I missing? >> What is the full path to: >> - the file below >> - CATALINA_BASE >> - CATALINA_HOME >> ? >> >> Mark > CATALINA_BASE: /usr/share/tomcat8 > CATALINA_HOME: /usr/share/tomcat8 > > /etc/tomcat8/Catalina/<hostname>/context.xml.default
That is the default context.xml file that gets applied to every web application. I'm guessing you have two web applications so a maximum of 2 * 25 connections - which is not what you want. If the context path is "/abcd" then you should use: /etc/tomcat8/Catalina/<hostname>/abcd.xml (assuming /etc/tomcat8/ has been configured as the configBase). For the ROOT web application (context path "") the file would be: /etc/tomcat8/Catalina/<hostname>/ROOT.xml Mark > > This is running on an AWS Linux EC2. > >> >>> <Context reloadable="true" crossContext="true" > >>> <Resource name="jdbc/------" >>> auth="Container" >>> type="javax.sql.DataSource" >>> maxTotal="25" >>> maxIdle="5" >>> maxWaitMillis="10000" >>> removeAbandonedOnBorrow="true" >>> removeAbandonedTimeout="60" >>> logAbandoned="true" >>> username="----" >>> password="----------" >>> driverClassName="com.mysql.jdbc.Driver" >>> url="jdbc:mysql://---------------------.us-east-1.rds.amazonaws.com >>> /----------" /> >>> </Context> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org