Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the metrics of server performance optimization

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "what are the metrics of server performance optimization?", so the editor summarizes the following contents, with detailed contents and clear steps, which can be used for reference. I hope you can get something after reading this article. Let's take a look at this "what are the metrics of server performance optimization"?

Interview scene

Interviewer: have you ever done any work related to performance optimization in your daily work?

First of all, let's analyze the following question of the interviewer. In fact, in my own experience in recruitment interviews, if the interviewer asks such a question. In essence, you don't just want the interviewer to answer simply: yes or no. Instead, I want to examine the following examinees' ability to think and understand the problem through this simple question. In essence, the interviewer wants the interviewer to talk about his or her experience in doing performance optimization and some theoretical understanding of performance optimization, such as the metrics of performance optimization and the problems that need to be paid attention to.

If the interviewer does not fully understand the interviewer's intentions during the interview process and squeezes out a little bit like toothpaste when answering questions, then, in most cases, the interviewer will think that the interviewer has little experience in performance optimization. At this point, the interviewer will greatly reduce the impression in the interviewer's mind, and the interview result will be very likely to be cold.

Measurement index

For performance optimization, there are many indicators to measure, which can be divided into: performance index, response time, concurrency, second opening rate and correctness, etc. We can use the following figure to represent these measures.

Next, we will explain these measures separately.

Performance index

Performance indicators can also include: throughput and response speed. What we usually call QPS, TPS and HPS can be summed up as throughput. There are many friends who may not know much about QPS, TPS and HPS. Let's talk about the meaning of these letters first.

QPS represents the number of queries per second.

TPS represents the number of transactions per second.

HPS represents the number of HTTP requests per second.

These are measures related to throughput.

Usually, when we do the optimization work, we should first make clear the matters that need to be optimized. For example: the optimization work we do is to improve the throughput of the system? Or do you want to improve the response speed of the system? Let's take a specific example: for example, there are some batch operations of databases or caches in our program. Although the response speed of data reading has decreased, our goal of optimization is throughput. As long as the overall throughput of the system increases significantly after we optimize, it also improves the performance of the program.

Therefore, optimizing performance is not just about improving the response speed of the system.

Here, optimizing performance is not blindly optimizing throughput and response speed, but finding a balance between throughput and response speed, using limited server resources to better enhance user experience.

Response time

There are two very important metrics for response time. That is: average response time and percentile.

(1) average response time

In general, the average response time reflects the average processing power of the service interface. The calculation is to add up the time spent on all the requests and divide them by the number of requests. Let's take a simple example: for example, we sent five requests to a website, and the time taken for each request was: 1msgravity, 2msgravity, 3msdepartment, 2ms, then the average response time was (1, 2, 2, 3, 2, 2) / 5 = 1.8ms, so the average response time was 1.8ms.

There is a problem with the indicator of average response time: if the request becomes slow in a short period of time, but passes quickly, the use of average response time can not well reflect the fluctuation of performance.

(2) percentile

Percentile means that when we optimize, we circle a time range, add the time spent for each request to a list, and then sort these times in order from small to large. In this way, we take the time to take out a specific percentile, which is the TP value.

The TP value means that requests exceeding N% are returned within X time. For example, TP90 = 50ms, which means that requests that exceed 90th are returned in 50ms.

Percentile is also an important indicator, reflecting the overall response of the application interface.

We generally divide the percentile into TP50, TP90, TP95, TP99, TP99.9 and other segments. The higher the value of the high percentile, the higher the stability of the system response.

Concurrent quantity

Concurrency refers to the number of requests that the system can process at the same time, reflecting the load capacity of the system.

When we optimize the high concurrency system, we often tune the concurrency, and there are a variety of tuning methods, in order to improve the ability of the system to process requests at the same time.

Generally speaking, the index of concurrency is relatively simple to understand, so I won't describe it too much.

Second opening rate

The second opening rate is mainly for front-end web pages or mobile APP, if a front-end web page or APP can be opened smoothly in 1 second, especially the loading of the first page. At this point, users will feel that the front-end web page or APP is very smooth to use, if more than 3 seconds or more, the user may directly exit the front-end web page or APP is no longer in use.

Therefore, to optimize the program in high concurrency scenarios, it is necessary to optimize not only the back-end program, but also the front-end and APP.

Correctness

Correctness says that no matter how and by what means we optimize the application, the optimized interactive data results must be correct. There can not be the phenomenon that the performance is relatively low and the data is correct before optimization, while the performance is relatively high after optimization, but the data is not correct.

Problems needing attention in optimization

Do not optimize at first (especially in the development phase) unless necessary.

Some optimization criteria are out of date and need to consider the current software and hardware environment (don't stick to the rules)

Don't overemphasize some system-level metrics, such as cache hit rate, but focus on performance bottlenecks.

Do not follow blindly, test, find the performance bottleneck of the system, and then determine the optimization means.

Pay attention to weighing the costs and benefits of optimization (some optimizations may require adjustments to existing architectures and increase development / operation and maintenance costs)

The goal of optimization is user experience, reducing hardware costs (reducing cluster size, independent of stand-alone high performance)

The optimization means of the test environment may not be effective for the production environment (optimization needs to be aimed at the real situation)

As for performance optimization, it is mainly carried out from two aspects, one is jvm. The other is mysql. I also sorted out two documents to take a look at the frequently asked questions in the interview.

Jvm

-, JVM memory area partition

II. JVM execution subsystem

three。 Garbage collector and memory allocation strategy

Fourth, write efficient and elegant Java programs

Fifth, performance optimization

Mysql

For MySQL, I have summarized a total of 21 techniques commonly used in practice and interview, so this document, whether for interview or job, can be used as a reference.

The above is about the content of this article, "what are the metrics of server performance optimization?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report