Three aspects of performance tuning considerations

- Why is performance tuning? -

In the final analysis on two reasons: First, for better system performance; second is to meet the growing business needs.

By tuning, you can use less hardware resources to support a greater number of business development, so as to achieve the purpose of saving hardware investment.

Meanwhile, can the limited resources, the expansion of the situation can not improve the response capacity of the system, giving users a better experience.

- Performance Tuning three systems -

Let us focus during our performance optimization, hardware, operating system, applications, these three systems, it requires some attention to detail and specific optimization ideas.

1. Hardware optimization. Mainly for the selection of hardware, such as CPU, memory, disk, and network cards.

2. The operating system optimization. Mainly it contains the operating system parameters, kernel parameters, process parameters, file system, disk IO and so on.

3. Application Optimization. It consists mainly of software applications, such as: apache, nginx, redis, Mysql, keepalived, kafka and so on.

The following describes the three major expansion system optimization.

-1 hardware optimization -

Before a business on-line system, we first need to enter the hardware purchase. Standard features of the hardware purchase is to run business systems and occupancy of resources.

For example A: If we want to set the line redis clusters.

redis is a memory database, characterized by a very large memory footprint. Hardware resources when purchasing important consideration is the memory, the first memory is larger, the second memory resources to be scalable.

redis disk read, write, and not very frequent, while disk space will not be much. Procurement disk, you can not require too much disk space, a common SAS disks can be.

         Example II: If we want to on the line is a database system?

Characteristics of the database system is consuming the CPU, the memory is also more cost, high data security requirements.

Whether you are using MySQL, SQLServer or Oralce, all you need to configure fast enough CPU, enough memory, enough stable and reliable hard drive, the hard drive needs to be done RAID, RAID10 best.

- 2. Operating System Optimization -

Between the operating system and the hardware application functions as a connecting role.

Related system parameters related to the priority of the efficient use of memory, IO call mechanism, the file system, process scheduling.

I will focus on Linux-based operating system performance optimization in the column "Linux Performance Tuning Guide", specific optimization includes the following aspects:

Operating system installation optimization
process management tuning
memory resource tuning
IO scheduler tuning
file systems Tuning
network transmission tuning

The bottom, is a hardware device (Hardware); cure is up to the program hardware (Firmware); followed by a device driver (Driver), is a specific form of software programs to interact with hardware devices.

Part of the operating system level, is the first system kernel (kernel), the kernel is the basis of system operation system libraries, shared libraries, the library must file (Libraries).

The top layer is the application (Applications) running on the system that we installed in the system, various application software, such as MySQL, Samba, FTP and so on.

It can be seen, the operating system from the underlying hardware optimization is a software application to the upper, step by step process of optimization.

- 3. Application Optimization -

The most intuitive performance is abnormal from the log and then comprehensive judgment optimization draw conclusions based on the log of strange.

The most easily overlooked is the code optimization, code for some performance issues entirely unreasonable. For example, for too many cycles, made a lot of unnecessary condition judgment, the same logic is repeated a plurality of times and the like.

After exclusion of the code level, we need to consider the architectural level, the level of configuration parameters and other aspects.

Tuning architecture includes separate read and write level, tuning means from the library multiple load balancing, horizontal and vertical sub-library sub-table, but also the connection pool tuning, excellent tone database parameters.

Finally, tune the MySQL database through a simple sum up the need to focus on what terms,

MySQL install the compiler to optimize
MySQL configuration files to optimize
MySQL storage engine optimization
optimization table type (MyISAM or InnoDB)
query cache optimized
SQL statement optimization
locking mechanism optimized
MySQL server optimization (operating system parameters, change SSD storage disk, etc.)

Guess you like

Origin www.cnblogs.com/java8899/p/11622824.html