The ultimate stress test that Tomcat can withstand

Reprinted from: http://tgyd2006.iteye.com/blog/321797 I
did a digital TV monitoring project last year, with a daily traffic of about 1.2 million. Of course, this total traffic is not very meaningful. It depends on the affordability of application services. The ability and duration of peak pressure.
The approximate test report is as follows. The complete test also includes a list of inconveniences such as the impact on the main business.

Background
1. Monitoring of user access to web-based value-added services.
2. Server hardware environment:
Dell™ PowerEdge™ 1950 Rack Mount Server
CPU PowerEdge™ 1950, dual-core Xeon processor 5120, 4MB cache
Memory: 2G
without load, single server.
3. The test is divided into pure task-free pages, with business multi-threaded memory operation (the host configuration is relatively basic, monitoring data cache memory, quantitatively storing text, directly storing the database host does not move).
4. Soft environment:
Windows 2003
Tomcat 5.0; Tomcat Initial memry pool setting 1G (Tomcat can only reach 1G startup memory at present)
J2SE 5
5. Testing tools:
loadrunner, etc.
Test summary
1. Empty page pressure test
Description:
Without For any business, the monitoring page is embedded with an empty page, and the tomcat is tested separately.
1.1 Without service monitoring 2000 concurrent test results:
1.1.1 After simulating 2000 users concurrent access per second for 20 minutes, the tomcat service memory overflows
(log 2007-03-16 15:59:52 StandardWrapperValve[jsp]: Servlet.service( ) for servlet jsp threw exception java.lang.OutOfMemoryError: Java heap space)
1.1.2 Response time: (page1: 3.859s, page2: 3.198s, page3: 2.443s, page4: 3.236s)
1.1.3 The actual page1\2\3\4 was clicked 152404 times, but 99890 responses were actually generated .

1.2 1000 concurrent test results without business monitoring:
1.2.1 The memory overflow of the tomcat service after the concurrent access of 1000 users per second for 30 minutes.
1.2.2 The average response time (page1: 3.245s, page2: 3.065s, page3: 2.68s) , Page4: 2.85s)
1.2.3 The actual page1\2\3\4 was clicked 160306 times, but 80,000 responses were actually generated.

1.2 With business monitoring.

  1. After 2000 users browsed for 10 minutes, the server tomcat service memory overflowed.
  2. After 500 users browsed for 30 minutes, the server tomcat service memory overflowed.

During the test, CPU: 1-3% Memory usage: 1G, relatively stable.
Reference conclusion: I
often see people on the forum asking whether to be able to bear such a problem if I want to visit 800,000 or 1 million Tomcat every day. In fact, the core still depends on how big the peak is and how long it lasts. And if it is not a special application, a site visits of 800,000, 1 million are fully funded to build a better application service system and cluster load.

  1. The peak concurrency is 2000 and lasts no more than 10 minutes, and the small peak concurrency is no more than 500 concurrency and lasts no more than 30 minutes. The normal state concurrency can run stably at 50PV/sec.
  2. The average daily concurrency is 50PV/sec, and the daily access is 4.32 million stable.
  3. Of course, if you access the data directly, and there are web pages for data query, update, modification, and deletion, this value will be greatly reduced. A simple test finds that it is about 1/5-1/4 of the above value.
  4. If your site has a more complex interactive design and more frequent database operations, it is recommended to use at least two servers for load. Generally, it can meet the daily average traffic of 600,000-800,000. At the same time, the peak value of 100PV/concurrency lasts for 10 minutes is not a big problem. . Of course, if this is the case, you have to consider the affordability of the database and the overall structure adjustment, and if necessary, simulation testing is still required.

In fact, there are many aspects to consider the capabilities of application services. In short, consider the peak value and duration first, and then consider the total daily traffic. When necessary, a combination of software and hardware such as load clustering and weblogic can be used to increase the processing capacity exponentially.
The test methods and test conclusions are very imperfect and are for reference only. The deficiencies and the wrong places are expected to be corrected.

Guess you like

Origin blog.csdn.net/qq_41489540/article/details/114223841