java tuning (1) Overview

Performance, refers to an article or matter has the properties and functions.

Performance of the program mainly by the performance of the following areas:

Execution speed: fast if the reaction procedure, the response time is short enough.

Memory allocation: memory allocation is reasonable, excessive consumption of memory or a memory leak.

Start Time: The program can be run from the normal time it takes to deal with business.

Load-bearing capacity: When the system pressure is increased, the execution speed of the system, whether the response time ascending curve gentle.

Let's understand a few concepts with performance-related

The performance of the reference index

Performance analysis requires quantitative evaluation of performance indicators, at present, commonly used in the quantitative evaluation of performance indicators are:

Execution Time : function code from the beginning to the end of the run time.

CPU time : the thread function or CPU-time.

Memory Allocation : occupied runtime memory space.

Disk Throughput : describes the use of I / O.

Network Throughput : Description network usage.

Response time : the system for a user action or event to make time to respond. The shorter the response time, the better the performance.

Performance bottlenecks

How much of a bucket filled with water, does not depend on the sides of casks highest piece of wood, but on the shortest piece, this theory is applied to optimize system performance, it can be understood, even if the system has sufficient memory resources and CPU speed, but if the disk I / O performance is low, then the overall performance of the system is determined by the slowest disk I / O speed of the current at this time, disk I / O is the system performance bottleneck.

Depending on the application characteristics, any computer system resources can become a bottleneck, where computer resources are most likely to become the bottleneck of the system are as follows:

Disk I / O : Because disk I / O read and write speed is much slower than RAM, the program is running, if you need to wait for disk I / O completion, so inefficient I / O operations will drag the entire system.

Network operations: due to the uncertainty of the network environment, especially for reading and writing data on the Internet, it may be the speed of operation of the network / O slower than the local disk I, therefore, as without special treatment, is also very likely to become a system bottleneck .

CPU : higher application requirements for computing resources, because of its long, uninterrupted take up a lot of CPU resources, then the competition for the CPU will cause performance problems. Such as scientific computing, 3D rendering on CPU need strong application.

Abnormal : for Java applications, and abnormal capture process is very resource-intensive. If the program is a high frequency of exception handling, the overall performance will be significantly decreased.

Database : Most applications are inseparable from the database, and read and write huge amounts of data is quite time-consuming. Application may need to wait for the completion of database operations or request returns a result set, then the synchronization operation will slowly become a performance bottleneck.

Lock competition : high concurrent program, if there is fierce competition in the lock, it is a tremendous blow to the performance. Lock competition will significantly increase the thread context switching. Moreover, these costs are unrelated to the application requirements overhead, taking up valuable CPU resources, but do not bring any benefit.

Memory : In general, as long as the program design is reasonable, in the memory read and write speed can not become a performance bottleneck. Unless the exchange program memory and high scanning frequencies, but these cases are relatively rare. The memory control system performance is most likely situation is insufficient memory size. Compared with the disk, memory size seems small, poor, which means that applications can only be used as core data is read into memory, which reduces system performance to some extent.

To improve system performance, mainly from the design tuning, tuning the code, JVM tuning, database tuning, operating system tuning a few aspects analyze performance issues, resolve system bottlenecks.

Guess you like

Origin www.cnblogs.com/liuzhenguo/p/11031260.html