Tomcat stress tests -Jmeter

  Tomcat optimized by adjusting the parameters and configuration

    1. Deploy a Web project on Tomcat

  Place the item under Webapps Tomcat unpacked directory

 

 

  1.2 modify the database connection parameters

    Into the project file to find and modify jdbc.propertise modify their own database connection parameters

 

   1.3 Starting Tomcat 'access to the Web project

 

   2.Jmeter stress testing tool

  The Jmeter decompression stress test tool into the bin directory

 

   2.1 Modify language

 

 

  2.2 Create a new thread group Right Test Plan> Add> Thread> Thread Group

 

 

  2.3 Create a new HTTP protocol sampler right thread group> Add> Sampler> HTTP request

 

 

  2.4 Create a new query results, click start test right HTTTP request> Add> listener> and view the results in tabular Aggregate Report

 

 

  3. Tomcat case without any configuration

  The average time of request processing: 6653
  Error error rate: 0.00%
  Throughput: 142 / S

 

 

  

   3.1 Optimization Option One: Disable AJP service modify the server.xml file

 

   

    test

 

  The average time of request processing: 4930
  Error Error Rate: 0.0%
  Throughput: 192 / S

   After disabling AJP service has improved testing throughput not necessarily accurate measure more than a few times so to

 

  3.2 Optimization Option Two: Start the executor (thread pool)

    Test 1: Up to 500 threads, initially 50 to modify the server.xml file

 

   test

 

 

  The average time of request processing: 4760
  Error Error Rate: 0.0%
  Throughput: 201 / S

  Throughput has improved

 

    Test II: set the maximum number of wait queue 

 

     test

 

 A test data compared to the slightly unsatisfactory

 

  Test three: the operating mode that is noi2

 

 

  test

 

 It can be seen nio2 performance than nio

 

  4. Adjust the JVM optimal parameters

Next, test by jvm parameter optimization, in order to test the consistency is still the maximum number of threads to 500, enable nio2 operating mode.
     4.1 garbage collector arranged parallel and generate log
 

 

 

      View the logs generated 4.2

 

 

     4.3 Test

 

 

    4.4 generated the log files to see gceasy.io

 

  Question one:

    The young generation gc 74 times, slightly more than the number of times, indicating the size of the young generation of inappropriate settings need to be adjusted
    FullGC have eight times, indicating the heap memory size is inappropriate, need to be adjusted 

 

 

   Question two:

 

    The reason can be seen from the GC, the young generation size is unreasonable, resulting in a number of GC.
 
   4.5 Adjusting the size of the young generation
    The initial heap size is set to 128m, up to 1024m 

 

 

    FIG adjusted to reduce the number of times GC

 

 

 

    4.6 Setting G1 Garbage Collector

 

 

  Pause time is reduced

 

 

Guess you like

Origin www.cnblogs.com/szhhhh/p/12457807.html