Performance optimization is to improve the system performance, reduce energy usage, or reduce the impact of applications on other parts. If the optimization is hasty or there is no measurement, of course, performance optimization may have a bad effect.
Performance optimization is to improve the system performance, reduce energy usage, or reduce the impact of applications on other parts. If the optimization is hasty or there is no measurement, of course, performance optimization may have a bad effect.
However, system performance tuning is more scientific than focusing on a little tuning.
Method
First, find out what the "normal" status is.
Find potential performance problems and adjust performance parameters to solve these problems. After adjustment, let's see how the system works and decide whether to keep the adjustment or rollback.
Summary:
- First, collect data to find the correct direction.
- Start optimization and select a reasonable Default Value
- Check the results. are our choices correct? Then, submit or return.
- Identify potential performance problems.
- Adjust optimization parameters
- Back to Step 3
Set the standard before you start
Measure before and after
With specific measurements, you can quickly set standards for your applications by using stress tests before and after changes. Let's take a look at the article using Apache Jmeter for stress testing, which is an example of the early sysadvent calendar.
Horizontal Measurement
If you can use charts for horizontal resource monitoring. Even in the automated analysis today, the previous Mk1 Eyeball is still very useful. For this reason, you need charts instead of full screen data.
(Of course, you can show these charts to your boss so that they don't think you have a meal in the company)
You should view the service usage and response time in a graphical manner. For web servers, the metric should be the number of requests, the time each request responds, and the size of each response message.
For apache and nginx, see daily logging in apache and nginx. This article describes how to record necessary quantitative indicator data logs.
You should describe the resource usage, queue, and response time in a graphical manner. This often means a resource map for disk and network I/O. Graphically describe the number of requests per second, as well as the request-response latency.
Tools for graphical display
I personally like to use Munin. This tool can be found in the EPEL repository. This tool is definitely an old-fashioned tool, but it is very easy to use, and it also has a wealth of plug-ins for use. When you install and use Munin, many graphical tools are installed by default. If you need more graphical plug-ins, you can find them on the contrib repository.
For some more advanced monitoring tools, Elasticsearch, Logstash, and Kibana are more popular in log analysis and visualization. Set ELK to load the data to be monitored, use Topbeat as the resource usage measurement standard, use Filebeat as the real-time Log File Analysis, and use Packetbeat to analyze online network data.
There are many optional tools, such as what you know, what you like, or what you want to learn. The most important thing you need to remember is to make sure that you know your benchmark data before you start the modification operation.