JDBC Pool Manager - Steady Pool Size Tuning
By shalini_m on Feb 10, 2009
Sun has recently announced the "GlassFish Enterprise Manager". I would talk about a particular feature : "Performance Advisor". One of the management rules of Performance Advisor is the JDBC Pool Manager. Jdbc pool manager tunes the steady pool size and maximum pool sizes of jdbc connection pools based on the load. This blog would briefly talk about steady pool size tuning.
Consider a cricket website. On a non–match day, there will be a minimum number of requests to this website. On a match–day, even if it is a working day, people tend to use such websites to check the runs and number of wickets. The number of requests will pour in as a result and for maximum resource utilization, the steady pool size needs to go up. If done manually, the administrator will have to configure this steady pool size.
After a while, number of requests are bound to come down. As a result, the steady pool size would have to be brought down. This constant recomputing of steady pool size based on the load is automated by the JDBC Pool Manager.
How is it Configured?
Assume there is a jdbc connection pool : cricket–info–pool. jdbc/cric is the resource that references this pool. The cricket–info–pool is set to a default steady pool size of 8. An application that uses the jdbc resource to get information from a database is set up. Client access this application to retrieve information. JDBC Pool Manager rule can set up from admin GUI.
- The Default Max Connections is the maximum number of connections that can be provided from the pool at any point of time.
- The management rule tunes the steady pool size in Sampling Frequency number of seconds.
- The sample size denoted by Number of Samples is used to calculate the moving average value for number of connections.
Marking cricket-info-pool under PoolNames will configure the rule for this connection pool. Click on Save after entering all the details.The domain needs to be restarted now, as the rule is configured for the target "server".
On domain restart, you can observe from the server.log that the steady pool size is recalculated to a certain value. After a while, assuming there are 500 client requests for a period of 10 minutes.
The steady pool size is recalculated every 60 seconds (default sampling frequency) to a new value suitable for the current number of requests.