Linux System Performance Testing and Analysis

Source: Internet
Author: User
Article Title: Linux system performance testing and analysis. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source. I. Preface

By introducing various performance-related links in the system, you can find out which aspects can be used in case of performance problems, and analyze the features of typical applications on system resource usage, this gives you a more intuitive understanding of the corresponding and system resource dependencies.

Most of the hardware performance problems are mainly related to CPU, disk, and memory, and have not encountered any impact on the performance of the entire application due to the operating efficiency of the development language, application design defects and database query abuse are the most common performance problems.

Note that, in most cases, although the cause of the performance bottleneck is poor program performance, insufficient memory, or disk bottleneck, the final result is CPU depletion, the system load is extremely high, the response is slow, or even the response is temporarily lost. Therefore, when we observe the server status, we first look at the system load and CPU idle. After reading this document, you will have an idea for system analysis.

  Ii. Purpose of Performance Analysis

Identify system performance bottlenecks

1) Hardware bottleneck

2) software bottlenecks

Provide Performance Optimization Solutions

1) upgrade hardware

2) Improve the system structure

Achieve reasonable hardware and software configuration

Balance System resource usage

However, it is a pity that another bottleneck or other problems often occur when a performance bottleneck is solved, therefore, the more practical goal of performance optimization is to make the resource usage of the system reasonable and maintain a certain balance within a certain range.

When the system runs well, it is precisely because all resources reach a balance body. The transitional use of any resource will cause damage to the balance system, resulting in extremely high system load or slow response. For example, the CPU usage may cause a large number of processes to wait for CPU resources, slow system response, and increase the number of processes and memory usage, memory depletion can also cause virtual memory usage. Using Virtual Memory can also increase disk IO and CPU overhead (CPU overhead for process switching and page-missing processing)

 Iii. Performance-related links

3.1 hardware resources

CPU

1) whether to use SMP.

2) the performance of a single CPU has a serious impact on some CPU-dependent applications, such as database query processing.

Memory

1) physical memory

Swap memory is used when the physical memory is insufficient.

2) Swap memory

Using swap memory will increase the overhead of disk IO and CPU.

Storage System

SCSI disk

ATA/SATA Disks

RAID disk array (RAID0, RAID1, RAID5, RAID0 + 1)

Some experiences

1) The performance bottleneck of reading and writing small files is disk addressing (random read/write performance is worse). The evaluation criteria are tps.

2) bandwidth is the performance bottleneck for reading and writing large files, and the evaluation standard is the continuous read/write speed.

3) Linux can use idle memory as the cache for file system access. Therefore, the larger the system memory, the better the performance of the storage system.

Bandwidth

1) network bandwidth

2) SCSI bus bandwidth

SCSI Bandwidth bottleneck during large File Access

3) system bus bandwidth

3.2 Operating System

SMP Performance

VM Performance

IO performance (storage device, network device, asynchronous IO)

File System Performance (large file optimization, small file optimization, write optimization, read optimization, Network File System)

Multithreading Performance

3.3 server software

I will not talk about the customization of different software based on different servers. There are too many server software.

3.4 development platform/middleware software/framework Software

There is no standard definition, depending on the situation.

3.5 applications

Some applications.

 Iv. Features of typical applications on system resources

4.1 Web applications dominated by Dynamic Content

1) frequent execution of programs, such as Perl, PHP, and Java, consumes a lot of CPU.

2) provides concurrent user access. As a result, many system processes consume a large amount of memory. When the memory is insufficient, using swap memory also increases the CPU overhead.

3) Frequent disk writes (mainly random writes), such as generating cache files and updating session files.

4) when the memory is sufficient, the read content can be cached. The cache hit rate is inversely proportional to the frequency of file updates, and the disk read IO is relatively small.

4.2 Web applications based on static content (such as Squid Cache)

1) network bandwidth bottleneck.

2) the random reading of small files is frequent. When the memory is sufficient, the random reading pressure on the disk can be mitigated.

3) when the system memory is insufficient, the disk IO volume will be relatively large (read, write, swap memory), thus increasing the CPU overhead.

4.3 database applications

1) The database query statements are complex. A large number of where clauses, order by, group by sorting, and so on are prone to bottlenecks in the CPU.

2) When the table is too large, querying and traversing the entire table results in a large amount of I/O reads on the disk, which is prone to read IO waits.

3) large volume of data updates or frequent updates, resulting in a large disk write IO volume.

4) Swap memory is frequently used when the memory is insufficient.

4.4 Software Download

1) network bandwidth bottleneck

2) storage system bandwidth bottleneck (read)

4.5 streaming media service

1) network bandwidth bottleneck

2) storage system bandwidth bottleneck (read)

 

[1] [2] Next page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.