当前位置:网站首页>[development of large e-commerce projects] performance pressure test - basic concept of pressure test & jmeter-38
[development of large e-commerce projects] performance pressure test - basic concept of pressure test & jmeter-38
2022-07-01 13:01:00 【Random stone light】
One : Pressure test
- Stress testing examines the maximum load that the system can withstand under the current hardware and software environment and helps to find out the bottleneck of the system . Pressure measurement capital It is to maintain the online processing capacity and stability of the system within a standard range , Know what you know .
- Use stress testing , We hope to find many kinds of errors that are more difficult to find with other testing methods . There are two types of errors that are : Memory leak , Concurrency and synchronization .
- An effective stress testing system will apply these key conditions : repeat , Concurrent , Magnitude , Random change .
Stress testing can simulate millions of users accessing at the same time , Detect concurrency , System problems are found through large concurrent stress tests .
1. Performance indicators
- response time (Response Time: RT) The response time is when the user starts a request from the client , The client receives a response returned from the server Should end , The time spent in the whole process .
- HPS(Hits Per Second) : Hits per second , The unit is time / second .
- TPS(Transaction per Second): The number of transactions processed by the system per second , Unit is pen / second .
- QPS(Query per Second): The number of queries processed by the system per second , The unit is time / second . For the Internet business , If some businesses have and only have one request connection , that TPS=QPS=HPS, One In general, use TPS To measure the entire business process , use QPS To measure the number of interface queries , use HPS Let's watch Click request... On the server .
- No matter what TPS、QPS、HPS, This indicator is a very important indicator to measure the processing capacity of the system , The bigger the better , According to Jing Examination , In general :
Financial industry :1000TPS~50000TPS, Not including Internet activities
The insurance industry :100TPS~100000TPS, Not including Internet activities
Manufacturing industry :10TPS~5000TPS
Internet e-commerce :10000TPS~1000000TPS
Medium sized Internet websites :1000TPS~50000TPS
Small Internet sites :500TPS~10000TPS - Maximum response time (Max Response Time) It means that the user sends a request or instruction to the system to respond ( Respond to ) The maximum time .
- Minimum response time (Mininum ResponseTime) It means that the user sends a request or instruction to the system to respond ( ring Should be ) The minimum time .
- 90% response time (90% Response Time) It refers to sorting the response time of all users , The first 90% The sound of
Response time . - Looking from the outside , Performance testing focuses on the following three indicators
throughput : The number of requests that the system can handle per second 、 Number of tasks .
response time : The time taken by a service to process a request or a task .
Error rate : Percentage of requests with wrong results in a batch of requests .
2.Apache JMeter
1)JMeter install
https://jmeter.apache.org/download_jmeter.cgi
2) Click on bin In the catalog jmeter.bat file
3)JMeter Pressure measurement example
1. Add thread group 

Details of thread group parameters :
- Number of threads : Number of virtual users . A virtual user occupies a process or thread . Set the number of virtual users here That is, set the number of threads .
- Ramp-Up Period(in seconds) Long preparation time : How long does it take to set the number of virtual users to start all . If The number of threads is 10, The preparation time is 2, You need to 2 Seconds start 10 Threads , It starts every second 5 individual Threads .
- cycles : The number of times each thread sends a request . If the number of threads is 10, The number of cycles is 100, So each line Process transmission 100 Requests . The total number of requests is 10*100=1000 . If I check that “ forever ”, Then all threads will Keep sending requests , Once you choose to stop the script .
- Delay Thread creation until needed: Delay thread creation until needed .
- Scheduler : Set the start time and end time of thread group startup ( When configuring the scheduler , The number of cycles to be checked is forever )
- The duration of the ( second ): Test duration , Will overwrite the end time
- Start delay ( second ): Test delay start time , Will override the start time
- Starting time : Test start time , Startup delay will override it . When the start time is over , Manually only need to test when the current Time will also cover it .
- End time : Test end time , The duration will cover it .
2. add to HTTP request 

3. Add listener 
4. Start the pressure measurement & View analysis results 
Result analysis :
- The error rate is the same as the development confirmation , Determine whether errors are allowed to occur or how far the error rate is allowed ;
- Throughput Throughput the number of requests per second is greater than the number of concurrent requests , You can slowly add ; If in the pressure measuring machine In case of good performance , The throughput is less than the concurrent number , It indicates that the number of concurrency cannot be increased , You can slowly Down , Find the best number of concurrency ;
- The pressure test is over , Log in to the corresponding web Server view CPU And other performance indicators , Data analysis ;
- maximal tps, Increasing the number of concurrent , Add to tps When it reaches a certain value, it begins to decline , Then the value is maximal tps.
- Maximum number of concurrent : Maximum concurrency and maximum tps It's a different probability , Generally, the number of concurrency is increasing , achieve After a value , The server experienced a request timeout , This value can be considered as the maximum number of concurrencies .
- Performance bottleneck occurs during pressure measurement , If the press task manager sees cpu、 The Internet and cpu All normal , Outstanding
To 90% above , This indicates that there is a problem with the server , The press has no problem . - Performance considerations include : database 、 Applications 、 middleware (tomact、Nginx)、 Network and operating system
- First of all, consider that your application belongs to CPU Intensive or IO intensive
3.JMeter Address Already in use Error resolution
windows The problem of port access mechanism provided by itself .
Windows Provide to TCP/IP The port of the link is 1024-5000, And it takes four minutes to recycle them . As a result When we run a large number of requests in a short time, the port is full . 1.cmd in , use regedit Command to open the registry
2. stay HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters Next ,
- 1 . Right click parameters, Add a new DWORD, The name is MaxUserPort
- 2 . Then double click. MaxUserPort, Input the numerical data as 65534, Base select decimal ( If it's distributed If you can , Both the control machine and the load machine need to be operated in this way )
3 Remember to restart the machine after modifying the configuration https://support.microsoft.com/zh-cn/help/196271/when-you-try-to-connect-from-tcp-ports-grea ter-than-5000-you-receive-t
TCPTimedWaitDelay:30
边栏推荐
- How can genetic testing help patients fight disease?
- Simple Fibonacci (recursive)
- 工具箱之 IKVM.NET 项目新进展
- GID: open vision proposes a comprehensive detection model knowledge distillation | CVPR 2021
- 题目 2612: 蓝桥杯2021年第十二届省赛真题-最少砝码(枚举找规律+递推)
- 天青色等烟雨
- Zabbix 6.0 源码安装以及 HA 配置
- 用.Net Core接入微信公众号开发
- System test UI test summary and questions (interview)
- Using burpsuite to capture app packages
猜你喜欢
随机推荐
高薪程序员&面试题精讲系列118之Session共享有哪些方案?
Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
项目部署,一点也不难!
Wechat simulated geographical location_ Camouflage wechat location
路由基础之OSPF LSA详细讲解
leetcode:241. 为运算表达式设计优先级【dfs + eval】
Hardware development notes (9): basic process of hardware development, making a USB to RS232 module (8): create asm1117-3.3v package library and associate principle graphic devices
[encounter Django] - (II) database configuration
Shell script imports stored procedures into the database
数论基础及其代码实现
oracle cdc 数据传输时,clob类型字段,在update时值会丢失,update前有值,但
SVG钻石样式代码
题目 2612: 蓝桥杯2021年第十二届省赛真题-最少砝码(枚举找规律+递推)
快速整明白Redis中的压缩列表到底是个啥
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
基因检测,如何帮助患者对抗疾病?
Perl 5.10.0 installation package download
What are the solutions for session sharing of highly paid programmers & interview questions series 118?
工具箱之 IKVM.NET 项目新进展
nexus搭建npm依赖私库









