In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. The purpose of performance analysis
1) identify system performance bottlenecks (including hardware and software bottlenecks)
2) provide a performance optimization solution (upgrade hardware? Improve the system structure? )
3) to achieve reasonable hardware and software configuration
4) maximize the balance in the use of system resources. In general, when the system is running well, all the resources reach a balance, and the excessive use of any resource will destroy the balance system, resulting in extremely high load or slow response of the system. For example, excessive use of CPU will cause a large number of processes to wait for CPU resources, slow system response, increase the number of processes, increase memory usage, memory exhaustion will lead to virtual memory use, and virtual memory usage will increase disk IO and CPU overhead.
two。 Factors affecting performance
1) CPU (a large part of the speed and performance of cpu determines the overall performance of the system, whether or not to use SMP)
2) memory (swap memory will be used when there is not enough physical memory, and using swap will bring the overhead of disk I0 and cpu)
3) hard disk (storage system)
Use of a.Raid technology (RAID0, RAID1, RAID5, RAID0+1)
b. The bottleneck of reading and writing small files is the tps of disk, and the performance bottleneck of reading and writing of large files is bandwidth.
C.Linux can use free memory as the cache for file system access, so the larger the system memory, the better the performance of the storage system.
4) Network bandwidth.
3. Steps for performance analysis
1) long-term monitoring and data collection of resource usage (nagios, cacti)
2) use common performance analysis tools (vmstat, top, free, iostat, etc.)
3) accumulation of experience
a. Defects in application design and abuse of database queries are most likely to lead to performance problems
b. Performance bottlenecks may be due to poor programs / insufficient memory / disk bottlenecks, but the final result is CPU exhaustion, extremely high system load, slow response, or even temporary loss of response.
c. Swap memory will be used when there is not enough physical memory, and using swap will bring the overhead of disk I0 and cpu
d. Problems that may cause cpu bottleneck: frequent implementation of Perl,php,java programs to generate dynamic web; database queries a large number of where clauses, order by/group by sorting.
e. May cause memory bottlenecks: high concurrent user access, many system processes, java memory leaks.
f. May cause disk IO bottleneck problems: generating cache files, frequently updating the database, or querying large tables.
Detailed introduction of 4.vmstat
Vmstat: used to monitor and display the virtual memory / CPU/ disk status while the system is running.
Simple example (interval 2 seconds, monitoring 2 times):
Important fields explain:
R represents the run queue (number of processes waiting to run)
B represents a blocked process
Size of swpd virtual memory used
The size of free's free physical memory, my machine has a total of 8g of memory, leaving 3415m.
Number of interrupts per second of CPU in in, including time interrupts
The number of context switches per second in cs, such as system calls, thread switches. Too many context switching times means that most of your CPU is wasted on context switching, resulting in less time for CPU to do serious things, and CPU is not fully utilized, which is not advisable.
Us user CPU time.
If the CPU time of the sy system is too high, it means that the system calls take a long time, for example, frequent IO operations.
Id idle CPU time, generally speaking, id + us + sy = 100.
Wt wait time for IO CPU.
Typical problem phenomena:
1.CPU problem
If a.procs.r continues to have a value and is larger than the number of system CPU, it is considered that the system is not sufficient to support the current load (because there are always processes waiting to run), which may be due to software implementation problems or the need to upgrade the hardware system.
B.cpu.id continues to be 0, which means that CPU is continuously busy. You need to continue to find the reason according to cpu.sy,cpu.us.
C. cpu.syjournal cpu.us is persistently high, and cpu.sy greater than cpu.us indicates that the system executes frequently in kernel state, and there may be frequent or more system calls or IO accesses.
two。 Memory problem
The a.memory.swpd value continues to have a value, indicating that the system is out of memory and uses virtual memory, which requires more memory.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
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.