How much do you know about performance testing? -Principle and architecture of performance testing tools
However, the performance test is not loadrunner, and all authors think so. But when they talk about performance testing, they say that loadrunner does, but there is only one difference. Do you think I will bear a grudge against loadrunner? The reason why I study it alone is that I hope that I will not be limited by loadrunner when I study performance testing. I just think it's easier to grasp the essence of performance testing without thinking of loadrunner. -In a narrow sense, we can divide performance testing tools into server-side performance testing tools and front-end performance testing tools. Server-side performance testing tools are usually considered as performance testing tools by our testers. LoadRunner, JMeter, SilkPerformance, and server-side stress performance tools need to support generating stress and load, recording and generating scripts, setting and deploying scenarios, generating concurrent users, and exerting continuous pressure on the system. Front-end performance testing tools are widely used by developers, front-end developers and testers. Firebug, Fieldder 2, Yslow and front-end performance testing tools only need to process the pages that client tools such as browser need to display. Principle of Server Performance Testing Tool The main function of the performance testing tool is to test the pressure load of the tested system by simulating the real business operation in the production environment, monitor the performance of the tested system under different business and pressure performance, and find out the potential performance bottleneck for analysis and optimization. Client and server are equivalent to two people, who communicate through information. Because I was embarrassed to communicate directly when I met for the first time, I found an intermediate messenger. The client told the messenger the information and the messenger conveyed it to the server. Then the information fed back by the server is also conveyed to the client by the caller. General performance testing tools need to record or write client behavior scripts. In this way, the communicator has the behavior ability of the client, thus pretending to be the client to cheat the server and communicate with it. Communicator can replicate itself through client behavior. Such that a plurality of the n communicators can communicate with the server. -This conveys people's behavior and ability, which is the basic feature of performance testing tools. Suddenly I feel that the performance tool is like a third party, and it is a crazy, abnormal and self-replicating third party, haha! For the popular performance testing tools at present, their basic working principles are the same. On the client side, virtual user access is simulated by multi-thread or multi-process, which puts pressure on the server, and then performance data is monitored and collected in the process. What characteristics should a performance testing tool have? 1, the tool itself occupies less system resources and has good expansibility and usability. 2. It can simulate real business transaction operation, and it can really generate business pressure when it is concurrent. (This is the core) 3. It can well analyze the performance of stress test results and quickly find the bottleneck of the tested system. 4. The test script has strong repeatability. Why am I so vague about the generation part of the schema user behavior of the server performance testing tool? For those who are familiar with loadrunner, I call it a virtual user script generator, which makes it easier for you to understand. This script can be recorded or handwritten. Don't think that this is the only way to generate user behavior. Because in JMeter, various components are added, and the user behavior is completed through the configuration of components, and of course, it can also be recorded. In the relatively simple performance testing tool curl _ loader (running in Linux environment), he describes user behavior by writing configuration files. As mentioned earlier, although the description forms of performance testing tools are different, the principle is the same, and they are all implemented through agents. Specifically, the proxy acts as an intermediary between the client and the server and receives data packets from the client. The pressure generator is used to generate the actual load according to the script content. In the performance testing tool, the pressure generator plays the role of "generating load". That is, according to the settings of root user, self-replication is performed to generate multiple clients to send requests to the server. For tools, each copy is a process or thread, and the running of the process and thread occupies system resources. Therefore, the number of virtual users that stress testers can run is also limited. It depends on the configuration of the foundation tester. Then at this time, it is necessary to simulate more virtual users sending requests to the server through the cooperation of multiple testing machines. Then, for performance testing, it is very important to generate "concurrent" requests, otherwise it will not bring pressure to the server. How do multiple computers produce "synchronized" virtual users? The user agent using the user agent is a process running on the load machine, which cooperates with the process or thread that produces load pressure, receives the command of the scheduling system, and schedules the process or thread that produces load pressure. In this sense, the user agent is also a part of the stress generator. Scheduling ability When we do complex performance tests, we often design various scenarios, different virtual users, different transaction users, running time, setting synchronization points and so on. At this time, we also need our test tools to have the ability of stress scheduling. In order to simulate the running scene we designed more realistically. Monitoring system Monitoring system is the main part of the performance testing tool that interacts directly with users. Monitoring system, the main users monitor all kinds of software and hardware during the stress test, such as monitoring the database, application server and the main performance of the server. Used to determine what state the system is currently in. Of course, the monitoring system is not an essential part of the performance tools, and it can be monitored by the monitoring tools of the hardware and software system itself or the third-party monitoring tools. But whether there is a powerful performance counter monitoring system is one of the indicators to measure whether the performance testing tool is powerful. Pressure result analysis The pressure result analysis tool can be used to help analyze the test results. Generally speaking, performance testing tools can generate graphs, line charts and other charts according to the performance technology counter values obtained by the monitoring system. By displaying various parameters and indicators in the process of performance testing, it can be analyzed by testers. However, what needs to be emphasized here is that the stress result analysis tool itself can not replace analysts to analyze performance results, but only provides a variety of different data disclosure and presentation methods. The analysis of these data must rely on the knowledge and experience of test engineers in system performance analysis. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? For example, some performance testing tools do not have the function of user agent, some monitoring systems have limited or crude resources to monitor, and some results analysis data are not detailed enough.