In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to optimize the performance of the Linux operating system. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Linux is a set of free-to-use and free-spread Unix-like operating system. Different distributions and different kernels of Linux have changed the parameters and settings, so that the system can achieve better performance.
CPU performance evaluation
You can find out whether there is a performance bottleneck in CPU through the following command, and then further check with top, ps and other commands to locate which processes are causing excessive CPU load.
Vmstat command: view the CPU load.
[blackfox@localhost ~] $vmstat 2 3 # interval 2s Print 3 times procs-memory- swap---io-----system---cpu-r b swpd free buff cache si so bi bo in cs us sy id wa st4 00 244824 932 497892 00 00 3 900 100 00 244824 932 497892 00 38 91 0 1 99 00 00 244824 932 497892 00 40 900 0 1 99 00
Sar command: statistics CPU performance.
Scenario: in a multi-CPU system, the overall utilization of CPU is not high, but the response of the system application is slow. Conclusion: only one CPU is used in a single thread, which results in an occupancy rate of 100% of the CPU and is unable to process other requests, while other CPU is idle, which results in low overall CPU utilization and slow application.
# sar-P 0 35 # count the first CPU
[blackfox@localhost ~] $sar-u 3 5 # shows CPU utilization at intervals of 3s Display 5 times Linux 3.10.0-327.el7.x86_64 (localhost.localdomain) 01 idle07:35:55 AM all 22 CPU 2017 _ x86 August 641 CPU 07:35:52 AM CPU% user% system% iowait% steal% 0.00 0.00 0.00 100.0007 Velcro 35 AM all 58 AM all 0.00 0.34 0.00 0.00 99.6607 VR 36 vane 01 AM all 0.34 0.00 0.00 0.00 0.00 99.3207:36:04 AM all 0.00 0.00 0.34 0.00 0.00 99.6607:36:07 AM all 0.34 0.00 0.00 0.00 99.66Average: all 0.14 0.00 0.20 0.00 0.00 99.66
Iostat command: viewing CPU usage
[blackfox@localhost ~] $iostat-cLinux 3.10.0-327.el7.x86_64 (localhost.localdomain) 01 avg-cpu:% user% nice% system% iowait% steal% idle0.13 0.00 0.23 0.01 0.00 99.63
Uptime command: average load for 1, 5, 15 minutes
Experience: the three values of 8-core CPU,load average are greater than 8 for a long time, indicating that the load is very high, which will affect the system performance.
[blackfox@localhost] $uptime07:54:27 up 17 days, 16:56, 1 user, load average: 0.00,0.02,0.05 memory performance Evaluation
Free command: view memory usage
Experience: available memory / physical memory
[blackfox@localhost ~] $free-m #-m in MB for continuous monitoring during-s period total used free shared buff/cache availableMem: 977 249 240 49 487 488Swap: 2048 0 2048vmstat command: monitor memory sar-r command: monitor memory disk Igo O performance evaluation
Sar-d command: statistics disk iBandO status
[blackfox@localhost ~] $sar-dLinux 3.10.0-327.el7.x86_64 (localhost.localdomain) 01 CPU 22 AM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm% util12:10:01 AM dev8-0 0.10 0.00 0.89 9.03 0.00 3.97 1.10 0.0112 dLinux 2001 AM dev8-00.05 0.00 0.35 7.56 0.00 64.63 61.70 0.2812 purl 30 AM dev8-0 0.02 0.00 0.16 7.08 0.01 254.77 128.
The iostat-d command:
[blackfox@localhost] $iostat-dx / dev/sda3Linux 3.10.0-327.el7.x86_64 (localhost.localdomain) 01 CPU 22 Device: rrqm/s wrqm/s r utilsda3 s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm% 0.00 0.01 0.01 0.05 0.21 0.34 17.98 0.00 41.36 30.56 42.60 7.77 0.05 Network performance Evaluation
Ping command: detect network connectivity
Netstat command:-I view network interface information,-r detect system routing table information
Sar-n command: displays the system network running status
[blackfox@localhost ~] $sar-n DEV 2 3 # DEV: network interface, EDEV: network error statistics, SOCK: socket information FULL: display all Linux 3.10.0-327.el7.x86_64 (localhost.localdomain) 01 327.el7.x86_64 22 CPU 2017 _ x86 August 641 CPU 09:26:26 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s09:26:28 AM eno16777736 0.00 0.00 0.00 0.0009 327.el7.x86_64 26 28 0.00 0.00 0.00
Traceroute command: trace packet transmission path
Nslookup command: judging DNS parsing information
Dynamic monitoring performance
Watch command: dynamic monitoring, which is executed every 2 seconds by default, and the execution result is updated on the screen.
[blackfox@localhost] $watch-n 3-d free #-n repeat execution time,-d highlight variable Every 3.0s: free Sun Jan 22 09:21:48 2017total used free shared buff/cache availableMem: 1001332 256792 245500 50948 499040 498864Swap: 2098172 2098172
This is the end of this article on "how to optimize the performance of the Linux operating system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.