Increase number of Tomcat connections pool

Asked

Viewed 334 times

0

I have a problem in my production server, where my tomcat has locked when a connection is requested from the bank’s connection pool. When I climb the tomcat I see in the log the following message :

ADVERTÊNCIA: Name = GaiaDataBase Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "40" for "maxActive" property, which is being ignored.

My context.xml Is thus configured:

<Resource auth="Container" driverClassName="org.postgresql.Driver" maxActive="40" name="jdbc/GaiaDataBase" password="blablabla" type="javax.sql.DataSource" url="jdbc:postgresql://192.168.1.78/MeuBanco" username="user_desenv"/> 

I thought that maxActive="40" would mean that I would have 40 simultaneous connections on pool. But this is not what happens according to the log.

How to increase these connections?

1 answer

0


The log says that maxActive is not used and that you should use in your context.xml the default maxTotal tag is 8. If this is the case, use maxTotal instead of maxActive.

Have to check the real reason Tomcat is "crashing", it shows error 500?

Checks if there is an error in the logs:

org.postgresql.util.Psqlexception: FATAL: Sorry, Too Many clients already.

If you find this error you must configure according to your need the Postgres configuration file called postgresql.conf, inside it you will have the flag max_connections = 100

  • There’s nothing on the console. As I use Tomcat’s connection pool, I saw that it hangs on the command line where Tomcat’s Datasource releases a new connection to my code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.