Connection pool

37 views
Skip to first unread message

DSAITES

unread,
Jan 13, 2021, 8:41:07 AM1/13/21
to Payara Forum

Good morning, I would like you to guide me on managing the connection pool in Payara, I will tell you what my problem is: I start the pool of connections with 10 minimum connections and I have configured 250 connections at most. The server when I reset the memory starts with 28% of RAM and in the day it goes up after two days it has 59% of RAM and although nobody is working on the system when I check the server I do not see that the% used in the RAM, I always close the connection used in any process or report that communicates with the database at the end of that process or report. Work with java + primefaces + postgresql + payara How can I get unused connections to be closed and RAM usage down? Is there a variable to set to close unused connections? If the minimum is 10 connections, should you expect that if more than 10 are being used and then the connections above the minimum are no longer used, lower the% of RAM?

Rudy De Busscher

unread,
Jan 19, 2021, 2:22:35 PM1/19/21
to Payara Forum
Hi,

There might not be a direct link between the Memory usage and the number of connections. The RAM can contain other information from previous calls that are not yet GCed because there was no need for it (59% is not that high)

When you do not get an OutOfMemory error after a few days there is probably not an issue. You can trigger a Garbage collection from the shell jcmd <pid> GC.run and see if memory stays that high. There is a way of resetting a Connection pool but it is not recommended (disrupt current requests and result in lower performance since connections need to be recreated).

If you are worried that connections are not properly closed, have a look at the leak detection feature https://docs.payara.fish/enterprise/docs/5.24.0/documentation/user-guides/connection-pools/leak-detection.html

Best Regards
Rudy

DSAITES DSAITES

unread,
Jan 19, 2021, 2:45:11 PM1/19/21
to Rudy De Busscher, Payara Forum
On Sunday 01-17-2021 I kept looking for information about the connections and I found this article which activated the two boxes that suggested and the time I put it in 5 seconds and I have two days that it does not upload more than 5 connections of the minimum number of connections I have it at a minimum of 30 and it reaches 35 as I see it in postgresql and with respect to memory it has been maintained at 33% for 2 and a half days, so I see that it has worked. I thank you for the tips that you gave me, I will be informing you or asking about another topic that comes my way. And for those who have the same problem that I had, this is a good configuration in your payara.

imagen.png


--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/30e3d4e2-ebea-4da4-bf0f-1c1c40bcd20dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages