In the previous section, we talked about throughput. As a user, you don't have to worry about throughput, but the response time is the main embodiment of the user's perception of system performance.
From the user perspective, software performance is the response time of the software to user operations. To be more specific, when a user clicks a button, it sends a command orWebClick a link on the page to display the operation results in a user-aware manner from the user's Click start to the application system, the time spent in this process is the user's intuitive impression on the software performance.
Response time Process Analysis
We need to break down this process to get the desired response time. I divided the entire process into three parts,Presentation time, data transmission time, and system processing time.
Rendering time
in fact, it mainly refers to the process in which the browser processes and displays the received data. A few years ago, everyone was using ie If the page displays slowly, we certainly won't blame ie only the network speed or accessed System of the telecom operator is blamed (in fact, in most cases, we will not consider the problem of access to the system ). Now chrome here, we will find the same website on the same computer, using chrome access, page rendering speed: ie slightly faster. This is the overall experience of various evaluations and public users. Of course, I personally think, opera the fastest display speed of the browser, but its display effect has never been very good.
Of course, I said that this presentation time cannot all blame the browser! Of course, it is also related to the operating system that hosts it, as well as computer hardware (suchCPUMemory ). If you have a super-fast browser and a very junk computer, I think you may be able to get stuck when you open two more pages.
Data transmission time
Never ignore the data transmission time. If you want to send a message to a friend from afar, what is the impact on your transfer of information to friends from afar? It is not the process of writing a letter (if you write a letter that is not as thick as a book), nor the process of reading a letter from your friends, but the process of sending a letter. (PS,Me10Days agoChina-PubThe book you ordered has not arrived yet!Xxx)
Taking the data transmission process of our system as an example, it takes time for us to send a request. It also takes time to return the request to us after the system completes processing. Performance testing tools for beginners like to use tools to test some systems on the Internet. Even students who do not know the performance think that performance testing tools can be used to crush and collapse some websites on the Internet. It seems that this tactic is more powerful than any hacker attack.
So I think these students should make up their network knowledge. What is your bandwidth? The Internet is a network, which is the same starting point and ending point. It may take different routes. Have you considered network latency? Even if your concurrent requests can be successfully sent, you can no longer call concurrency at the destination.
This is also why we generally emphasize the need to conduct performance tests on the LAN. Of course, there are also special performance tests that need to be performed on the Internet. They do not focus on the user's maximum concurrency.
System Processing Time
After obtaining the request, the system processes the request and returns the result. Then I conduct a performance test mainly to verify the processing time of the system, because the previous presentation time and data transmission time are not controllable, and the user's computer and browser vary widely, the user's network conditions vary widely. The only thing we can control is to reduce the system's request processing time to the most short.
If we analyze and explain the processing of the system, it will be a very large and complex process. Language, language framework, middleware, database, system architecture, and server system. Therefore, we still have a long way to become a good performance testing engineer.
Practical Energy Testing
After listening to the above analysis, it seems that every process is a "waste" of time. How can we test the processing time of the system?
In fact, the present test tools all mask the rendering process, only simulate multi-user concurrent requests and calculate the response time of the user. The page does not display every response of the server to the client.
For the problem of data transmission, this is also the performance test that I want to emphasize should be carried out in the LAN, which is generally not subject to data bandwidth restrictions. Therefore, the data transmission time is negligible.
Definition of response time:
Response time
It refers to the time when the customer sends a request to get a response. In some tools, the request response time is usually called"TTLB"(Time to Laster byte ),It indicates the time elapsed from initiating a request to receiving the last byte response from the client.
System response time
The amount of time the application system spends from sending a request to receiving a response from the client.It must be noted that such a definition is completely personal. You can raise an objection.
Let's look at two situations.:
When I access the Baidu homepage and send a request, Baidu starts to return page data to me. When both the search box and the Search button are returned to the page, the icon is still being sent. I don't think this response is complete. It is complete to return all the information on the page to me, and all the results I want are returned to me. This situation is more in line with the definition of "corresponding time"
A system has an information query function. When I enter a condition to query, millions of data records may be queried, query all the data and return all the data to me. It may take a long time for the server to query the data, and all the data received by my computer may only be dropped. Then the server may only Query100And return the data to me. When I click "next page", the server queries again and returns the data on the second page to me. This situation is more in line with the definition of "system response time.
A special note on the response time is that for the customer, whether the value can be accepted is subjective, that is, there is no absolute difference between "long" and "short" response time.
Reasonable Response Time
There is a general standard for user response time on the Internet.2/5/10Second principle.
That is to say, in2Response to the customer within seconds is considered a "very attractive" user experience. In5Respond to the customer's "relatively good" user experience within seconds10Respond to the user experience that is considered "bad" within seconds. If10Seconds have not received a response, so most users will think this request is failed.
Here we also need to consider the concept of frequency of use.
My earliest InstallationWindowsThe system may need1Why do we think this is normal because it takes a long time for us to install the system. If the system is used properly, it may take several years for a system to be reinstalled, it takes so long for us to install any small software on the system that we cannot bear. For software control, they often install a variety of fresh and interesting software for use.
For a tax report system, users of this system use it once a month and spend3Hour data input,
After you click the submit button10The message "processing successful" is provided in minutes, which is acceptable to us.
Therefore, during performance testing, the "reasonable response time" depends on the user's needs, and cannot be determined based on the tester's own ideas.