[jboss-user] [Performance Tuning] New message: "Re: jboss performance tuning"

Peter Johnson do-not-reply at jboss.com
Thu Feb 11 11:31:10 EST 2010


User development,

A new message was posted in the thread "jboss performance tuning":

http://community.jboss.org/message/525812#525812

Author  : Peter Johnson
Profile : http://community.jboss.org/people/peterj

Message:
--------------------------------------------------------------
Please, no large fonts - it makes it appear as if you are shouting.
 
How many database connections are allowed in the MySQL configuration file (max_connections)? The typical default is 100 connections. You need to ensure that max_connections and <max-pool-size> agree.
 
Is JBoss AS the only user of the database? If not, then you also have to account for the number of connections used by the other apps that access MySQL (i.e., increase max_connections).
 
How many connections do you need? That depends on your application. Does every request require a connection? Or only a certain percentage of requests? Also, how long is a connection held for a typically request? How does your database perform under a high load; in other words, can it handle a large number of simultaneous requests and still provide adequate response times? All of these will factor into the number of connections. You do not want to overload the database.
 
Also, consider the <blocking-timeout-millis> setting. This value states how long a request will wait for a connection if one is not available. In effect, it says how long the waiting queue is. At times, especially if the database is overburdened, it is best to limit the number of actual connections and make requests wait for an available connection. If most of your requests hold onto connections for only a brief time, then having reusts wait for an available connection should not be a problem. Of course, you need to ensure that in your request processing that connections are obtained only once absolutely necessary and released as soon as possible. If you are using an ORM library such as Hibernate (or JPA) then you will either have to observe how your code cuases connections to be made and released, or see if there are best pratices for that ORM tool in regards to minimizing connection duration.
 
Usually, saying that there are 500 simultaneous requests, and each needs a connection, and thus max_connections and <max-pool-size> need to be 500, is a bad idea. And the only way you will find the real sweet spot is to perform load testing, usally starting with a small number of users and the rerunning the load tests, increasing the number of users each time until the system can no longer handle the load. At which point you need to identify the bottleneck and determine if there is anything you can do to elimiate it. In our load testing we usually start with 10 users, then go to 50 and then increase but 50 for each iteration until we hit the limit. But then our load tests include think time. If you don't have think time, start with 2 or 5, and increase by 5 each time.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/525812#525812




More information about the jboss-user mailing list