1 2 Previous Next 15 Replies Latest reply: Mar 4, 2014 3:51 AM by PrincessPoonam RSS

    Java web application performance tuning

    enzo_rio

      Hi Experts,

       

         I have been given an opportunity to take up performance tuning task for a Java/J2ee online shopping site.

      I want to know what are the steps to follow in order to tune the performance.

       

      1. What will the PT Test reports contain???

      2. What do i need to ask the PT team in order to understand where the performance is getting hit???

      3. My role is a  Performance Tuning  , should i use any tools to analyse the CPU,Memory and JVM , Thread???  usage??

       

      Please give me standard approach to follow to do performance tuning... What are the things to do when the testing team is ready to do the PT.

       

      1. Do i need to ask for server logs to see what is happening???

      2. Any specific reports????

      3..etc etc..

       

       

      Regrads

        • 1. Re: Java web application performance tuning
          gimbal2

          What do you think? I mean you're the one that has to do the job, you are now basically going to prove you don't have a single clue??

          • 2. Re: Java web application performance tuning
            jschellSomeoneStoleMyAlias

            First determine a realistic request profile for production traffic.  What requests come in?  How complex are they?  How do they vary? 

            Ideally you should also know about sustained versus burst, but that isn't essential.  You should try to measure this rather than guessing.  Measuring however can consist of something like counting database records over a period of time and then averaging then projecting to requests needed for that.

             

            Second you need to simulate the above.  Write a tool or find one.  Insure that it can run unattended for long periods of time.  Based on your application you will need to run at least two clients (tool instances simulating a client.) 

             

            Third find a profile tool and learn how to use it.  Specifically understand what the metrics mean.

             

            Fourth set up an environment which would normally involve at least the following

            1. One client machine.

            2. One server machine with application running

            3. A network between the two which is not being used by other users.

             

            One client machine is often sufficient to run multiple clients

             

            The last isn't essential but it you try running a maximum test during the business day on the developer network it might impact them.

            More equipment might be needed if the production system is complicated however that often isn't the case because it will often be the case that a single application is the bottleneck, so all the other applications have no problem keeping up.  (I haven't been able to load a database server for years excluding obvious badly designed application code.)

             

            Initially you should monitor network traffic and CPU from the **client** machine.  You want to make sure that your clients do not bottleneck (no that the network does.)   Probably won't happen unless one is careless with the client.

            • 3. Re: Java web application performance tuning
              gugalnikov

              I would take the following steps:

               

              1. Clearly identify the system architecture

              2. Identify the technological elements you are working with (application server, web server, JVM type and version, operating systems, databases, frameworks, load balancer, etc, etc)

              3. Once you have the picture clear, select some appropriate tools to do measuring, profiling, etc. Also analyze in detail all the configurations, look out especially for: JVM flags, heap size, timeouts, connection pooling, session management, data access.

              4. Ask the client for logs, metrics & reports (volume, concurrency, usage peaks, resource allocation, etc), snapshots, anything they can give you to start analyzing the performance issues they've been experiencing

              5. Direct observation and day to day measuring is very important, this job has to be done in a very organized and methodical way

              6. Once you start identifying some issues and recommendations, start applying them one at a time and measure their effect thoroughly before applying the next one

              7. Always have a plan / procedure for rolling back any changes to the last working state of the system

               

              Hope this is helpful for you, if you can provide more information i can give you more specific advise

               

              Best regards

              • 4. Re: Java web application performance tuning
                PrincessPoonam

                Hi,

                Thanks all for your valuable time and advice.

                 

                @ gugalnikov : 

                  Right now the testing team is doing the Performance Testing of the application. 

                1)  I am a part of the Tuning team, should i use tools to do measuring and profiling ??? or do the development team do this and give a report??? ( what is the common practice).

                2) If i have to do it which are the recommended tools .. I goggled and downloaded JProfiler.

                 

                 

                Thanks.

                • 5. Re: Java web application performance tuning
                  gugalnikov

                  Hi,

                   

                  As part of the Tuning Team, it is common practice that you do measuring and profiling; you must do this before, during and after the tuning procedures in order to correctly identify and document the improvements.

                   

                  The tool to be used depends on the JVM, if it is an Oracle JVM for example (Jrockit, JDK 1.7), you can use Mission Control which is very effective, if it is the HP JVM then you should use HP JMeter.

                   

                  I also recommend Visual VM and the corresponding Eclipse plugin in case it does apply to the JVM you will be tuning.

                   

                  It is important to identify which JVM you will be profiling and tuning, because the behavior and parameters may vary depending on this.

                   

                  Best

                  • 6. Re: Java web application performance tuning
                    jashburn

                    I just so happen to come across this a few moments ago: The Principles of Java Application Performance Tuning | CUBRID Blog . It gives you a good overview on the tuning process, and the different facets of tuning. Be cognisant of the Pareto principle and the balloon effect to achieve good return on investment.

                    • 7. Re: Java web application performance tuning
                      PrincessPoonam

                      Hi All.

                       

                       

                       

                            Thanks a lot for your valuable inputs.

                       

                       

                            This is my first experience in performance tuning,  i am a novice, i really appreciate your patience in replying.

                       

                       

                        1. I would like to know how do i actually know that there is a problem and it needs tuning??? Can any body please share any of there experience with an example.

                       

                       

                      --->  I know it totally depends on each system and its system dependent, and it cannot be generic solution. Please try to give an example from your past experience.

                       

                       

                      ---> Are there any formulas to calculate the performance based on the test results.

                       

                      The PT is not started, all that i have is.

                       

                      1  Scenario/Use case

                      2. Target Volumes (Business Hours and Non-Business Hours)

                      3.Response Time

                       

                      Example 1:

                       

                      1)  Scenario 1: xyz 

                           Business Hours : 2350/hour

                           Non Business Hours : yet to be determined

                           Response Times :  < 5 sec

                       

                       

                       

                       

                       

                      Thanks. 

                      • 8. Re: Java web application performance tuning
                        jashburn

                        I would like to know how do i actually know that there is a problem and it needs tuning???

                        Take a look at Figure 1 in the page I linked to from my previous reply. The answer to the decision boxes in the flow chart partly depends on non-functional/performance requirements (i.e., the performance targets such as those in Example 1) and common sense.

                         

                        In terms of common sense, if, e.g., a performance requirement is for the application to be able to respond to 1 million concurrent connections and have a response time of <5 sec for each connection, then you go to the "Reconsider the expected performance" box in the flow chart to question if this is a valid requirement - if it is really needed by the business, and if the business is willing to invest in the hardware and software to meet this requirement.

                         

                        Let the Performance Testing team to run one round of tests to see how well the application performs. If the application is not meeting the performance target for some of the scenarios, then you proceed to the "Application change" box in the flow chart, i.e., find out where the bottleneck is, determine if it will need code change or if it can be improved by changing system (application, JVM, etc.) parameters, and apply the change.

                         

                        ---> Are there any formulas to calculate the performance based on the test results.

                        Why do you need a formula when you have scenarios with expected volume and response time? Wouldn't it be that it is either the application meets the performance targets or not?

                        • 9. Re: Java web application performance tuning
                          rp0428
                          This is my first experience in performance tuning,  i am a novice,

                          Ok - so don't you think it makes sense to actually ask someone that already knows how to do it?

                           

                          And didn't you also say this?

                          Right now the testing team is doing the Performance Testing of the application.

                          Ok - and don't those people already know how to do it?

                           

                          Hmmm - see if you can figure out what the best plan of action

                           

                          1. You should ask someone that already knows what you want to learn

                          2. You have people there now that 'already know what what you want to learn

                           

                          What does that suggest to  you? Post your answer here.

                          • 10. Re: Java web application performance tuning
                            PrincessPoonam

                            @ above,

                             

                              I said they are doing Performance Testing , and i am suppose to do the Tuning of the application.

                             

                            There is a team to test , but i am the only person here to tune the application. I have no body to take help from , so i am posting my question on this forum.

                             

                             

                            Thanks.

                            • 11. Re: Java web application performance tuning
                              jashburn

                              ,

                               

                               

                              • 12. Re: Java web application performance tuning
                                gimbal2

                                I have the same experience, yeah. The testers tend to be purposely not so technically-inclined so they can't be influenced by knowledge of how it should be.

                                 

                                Its a tough job (performance tuning I mean), but somebody has to do it. The first question to answer is WHO has to do that. If you have to ask "so what do I do", then I'm afraid my answer would be "Well you should be following the example of the experienced senior who is made responsible for this task."

                                • 13. Re: Java web application performance tuning
                                  rp0428
                                  Its a tough job (performance tuning I mean), but somebody has to do it. The first question to answer is WHO has to do that.

                                  I disagree - the first question to ask - is: does anything NEED to be tuned.

                                   

                                  If the performance testing team can't answer that question then either there is NO tuning to do or that team is incompetent.

                                   

                                  The SOLE responsibility of a performance testing team is to identify any performance issues that need to be addressed.

                                   

                                  So the obvious first step to take, which OP doesn't seem to have done, is to ASK that team about their findings.

                                   

                                  I, for one, would not spend any time at all trying to 'tune' anything if that team hasn't identified any issues or problems.

                                  • 14. Re: Java web application performance tuning
                                    gimbal2

                                    I disagree with your disagree; first you answer WHO is going to do it and THAT person (or group of people) will answer if anything NEEDS to be tuned.

                                    1 2 Previous Next