Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the performance comparison of Tomcat 7 before and after optimization?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how the performance of Tomcat 7 is compared before and after optimization. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

I. operating environment

CPU: Intel (R) Pentium (R) P6200@2.13GHz

Memory: 4G, 32-bit win7, only recognize 3G, no time to deal with ramdisk and so on

Operating system: win7 32 bit

JDK:1.7.0_55

Tomcat:7.0.53

Don't laugh, the company computer is equipped with this, slow to death, tragedy!

All of the following tests are based on 1000 requests and access to Tomcat's default ROOT home page

2. Before tuning

The number of concurrent users is tested one by one from 10 to 1000. The test results are as follows:

From the above test results, except for 200user concurrency (when you may be doing GC), the throughput and request processing time are relatively stable, but the request waiting time increases sharply later. It is observed that the CPU load is less than 80%.

III. After optimization

Optimization is mainly done for Tomcat, mainly in two aspects:

1. Add the following parameters to the bin/catalina.bat file to optimize the JVM. As for the function and description of this camel parameter, there should be many, such as: http://www.mzone.cc/article/321.html

Set JAVA_OPTS=-server-Xms1000M-Xmx1000M #-Xms is set to the same value as-Xmx to avoid performance ups and downs caused by frequent GC in JVM-Xss512k-XX:+AggressiveOpts-XX:+UseBiasedLocking-XX:PermSize=64M-XX:MaxPermSize=300M-XX:+DisableExplicitGC-XX:MaxTenuringThreshold=31-XX:+UseConcMarkSweepGC-XX:+UseParNewGC-XX:+CMSParallelRemarkEnabled-XX:+UseCMSCompactAtFullCollection-XX:LargePageSizeInBytes=128m-XX:+UseFastAccessorMethods-XX:+UseCMSInitiatingOccupancyOnly-Djava.awt.headless=true

The above configuration can basically achieve:

Faster system response time

The speed of JVM recovery increases without affecting the response rate of the system.

JVM memory utilization

Minimize thread blocking

2. The optimization of Tomcat connection parameters is mainly aimed at throughput:

Modify the conf/server.xml file to change the original

Change it to the following

Then let's take a look at the performance of 1000 requests made by 10-1000 concurrent users.

As you can see, after optimization, the throughput has reached an average of about 1800-1900, while the processing time is basically stable at 0.6ms, while the waiting time is less than 600ms.

Through the comparison of the two results, we can see that the throughput and server processing time have greatly improved. Of course, this is the only effect on my stupid machine, and no matter how optimized it is, it will not "fly". Interested friends can find a cow B-point machine to try it on their own. Hope to tell me the result after the trial and make me happy.

The above is how the performance of Tomcat 7 compares before and after optimization. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report