5 Replies Latest reply on Feb 24, 2010 12:24 PM by Peter Johnson

    jboss performance tuning

    Abhishek sharma Newbie
      Hi
      I am working on OFBiz project. I am running OFBiz on Jboss. My requirement is to allow 1000 concurrent users to access the  application. But when I try to access the application with 150 users, it throws an exception (Could not establish a connection with the database). The configuration settings are as folows:
      Hardware: Dual  core processor, 2 GB RAM
      OS: Windows XP
      Database: MySQL which allows 1000 connections concurrently
      Jboss: In jboss-web.deployer/server.xml
                   <Connector port="8080" address="${jboss.bind.address}"   
                maxThreads="250" maxHttpHeaderSize="8192"
                emptySessionPath="true" protocol="HTTP/1.1"
                enableLookups="false" redirectPort="8443" acceptCount="100"
                connectionTimeout="20000" disableUploadTimeout="true" />
              
                 In conf/jboss-service.xml
                <attribute name="MaximumPoolSize">500</attribute>

      If any one have any idea please help me to solve my problem.
        • 1. Re: jboss performance tuning
          Peter Johnson Master

          The server.xml file covers only HTTP connections, not database connections.

           

          In your *-ds.xml file, what is the maximum number of connections allowed? In your database configuration, what is the maximum number of connections allowed?

           

          What database are you using?

           

          What is meant by 1000 concurrent users? All logged in at the same time? Or all with active threads processing requests? I ask because in order to do the latter you would probably be looking at around hundreds of thousands of logged in users. For a shop with thousands or even tens of thousands of users, 50-100 concurrently processing requests is more typical.

           

          Last Friday I was an a mini conference where a presenter was talking about load testing. His marketing department said thay they needed to load test for 30 million users. By the time he pinned them down on what they meant by that number, and told then what load tesing such an amount would cost, they finally settled on a much smaller number of concurrent users. In the end, his load test tested only up to 50 concurrently processing requests. And yes his system is now live and supports 30 million users, the vast majority of which are registered with the site but access the site maybe once a month.

          • 2. Re: jboss performance tuning
            Abhishek sharma Newbie

            Hi Peter,

            Thanks for your reply.

            I am using MySQL5.0 database. In my mysql-ds.xml file, I have defined

             

                  <blocking-timeout-millis>8000</blocking-timeout-millis>

                  <idle-timeout-minutes>1</idle-timeout-minutes>

                  <min-pool-size>5</min-pool-size>

                  <max-pool-size>500</max-pool-size>

             

            In my application, 1000 concurrent users means, atleast 300 users should be able to log-in at the same time and rest of them can access the application. So please tell me what settings are required in jboss to achieve this requirement.

            • 3. Re: jboss performance tuning
              Peter Johnson Master

              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.

              • 4. Re: jboss performance tuning
                Abhishek sharma Newbie

                Hi Peter,

                Thanks for the reply

                I am doing the load testing on my application using Jmeter with the following configuration:-

                No. of processors: 4

                RAM: 4GB

                OS: Red Hat 5 64 bit Linux

                Database: My Sql 5.0

                Server: JBoss 4.2.2

                When I inject the load for concurrent users and observes the "No. of Threads" on web-console, it always increases continuously and never decreases.

                If you have any idea, please tell me, why it increases continuously.

                Since threads create on stack, how can we free the stack memory? Please help me

                 

                Thanks & Regards

                • 5. Re: jboss performance tuning
                  Peter Johnson Master
                  I have no idea where the web-console is getting "No. of threads". I never use the web-console since it is an orphan and has not been updated in ages. If you knew of a specific MBean attribute then I could probably tell you more about what that number means. There is a counter that tracks threads created, and that always increases. There are also counters for max threads and current threads. You can see the MBeans in the jmx-console.