Frequently Asked Questions about Stress Testing Flash Sale Scenario

When many people perform stress testing on flash sale scenarios, they often encounter the following two problems:

1. Use your laptop to initiate 1,000 requests instantly

2. No virtual IP is used (requests initiated are all from the same IP)

In fact, many people now encounter these two problems when doing flash sale stress testing. The first problem is to use a client machine to conduct the stress test and initiate about 10,000 requests. This is not possible. The client can make up to 1,000 requests. Because each thread requires at least one megabyte of memory to start, if you start 1,000, it will require nearly 1GB of memory. Moreover, to start 1,000 requests, the configuration requirements for the press of this client are also very high. It is not recommended to start within 3 seconds! If 1,000 threads want to be started, it will take at least 10 seconds to start. Many people only use 1-3 seconds to launch 1,000 threads, which basically fails.

Another problem is that the 1,000 requests initiated now are all used on your local client, that is, the 1,000 requests initiated by the 1,000 threads initiated by your own computer are actually all one socket. Link, because your computer has only one IP and the same port number, so when the client and server establish a link, there is only one socket link. In fact, it does not completely simulate the flash sale of a large number of concurrent users. scene, so it was all wrong from the beginning.

My suggestion is: when doing this stress test, especially when doing a flash sale stress test, it is best to communicate with the relevant R&D, the architect, and the product manager. You need to What kind of scene is simulated is the most important thing. When you want to simulate 1,000 people buying flash sales, you have to consider how these 1,000 people buy flash sales. These 1,000 people must come from different laptops, mobile phones or customers. Everyone must be using a different IP. If you use a computer to simulate it now, it must be created with one IP. This is completely wrong!

In addition, if you want to simulate the concurrency of 10,000 people, then you have to consider 10 laptops to form a distributed system to start these 10,000 threads, and these threads must have independent IPs, so that you can truly simulate the sending of such customers. Flash sale on the terminal! To simulate 10,000 people for client, rush purchase, and flash sales, 10,000 socket links must be established.


 How to obtain information

【Message 777】

Friends who want to get the source code and other tutorial materials, please like + comment + collect , three times in a row!

After three consecutive rounds , I will send you private messages one by one in the comment area~

Guess you like

Origin blog.csdn.net/GDYY3721/article/details/132279463