Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basic knowledge of cloud computing? how to troubleshoot Linux system?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What are the basics of cloud computing? How to troubleshoot Linux systems? Dealing with Linux and analyzing system performance on servers is a daily job for every Linux operations engineer or cloud computing developer, and performance optimization is seen as one of the most challenging jobs in software systems, giving staff a headache. The following is a quick way to troubleshoot online Linux systems in cloud computing learning.

Linux performance optimization is a system engineering, in addition to learning those basic knowledge points, there are two more important points: 1) master the ideas and methods of performance optimization, try a large number of Linux performance tools;2) from learning to output, that is, continuous practice, from practice to sum up experience. Only by combining theoretical knowledge with practice can you relate observed performance problems to system principles.

The causes of online Linux system failures usually include the following aspects:

CPU usage is too high.

An application is CPU intensive, and unless it is computationally intensive, it is usually due to an endless loop. The screening techniques are as follows:

1)Locate CPU-heavy processes with the top command. For example, process PID41843 occupies too much CPU, obviously there is a problem, and the process id is located. Of course, if you want to observe only the CPU and memory and load of process PID41843, you can use the command: top -p 41843

2)Locate the CPU usage of each thread in the problem process through the top command. Use the command: top -p 41843 -H

3)Locate the problem code with the jstack command. For example, if the CPU occupied by thread PID41892 is found to be too high, this PID is converted to hexadecimal, where PID41892 is converted to hexadecimal as a3a4. Use the following command to locate the problem code: jstack 41892| grep a3a4

Second, the memory occupation is too high

In Java development, common exceptions and solutions are as follows:

java.lang.OutOfMemoryError: PermGen space

Reason for exception: If there are many CLASS in the application, it is likely that a PermGen space error will occur. WEB or APP uses a large number of third-party jars, its size exceeds the jvm default size (4M) will generate this error message.

Solution: Adjust the size of PermSize and MaxPermSize; reduce jar reuse and reuse memory.

java.lang.OutOfMemoryError: Java heap space

Reason for exception: In JVM, this exception message is thrown if GC is used 98% of the time and the available Heap size is less than 2%. Tip: Heap Size should not exceed 80% of available physical memory, generally set the-Xms and-Xmx options to the same, and-Xmn is 1/4 of the-Xmx value.

Abnormal cause troubleshooting steps:

1)Query gc status via jstat command. After locating the PID of the process with high memory occupation through the top command, check the GC of the process. Command: jstat -gccause 41843 2000

2)Query the memory usage of process entity class by jmap command. If gc is found to be very frequent in step 1, you can query the process entity class memory usage using the jmap command. Command: jmap -histo:live 41843| head -n 100

3)Query the usage of the process heap with the jmap command. If the above does not identify problems, you can look at the use of the new generation, the old generation and the permanent generation in the process. Command: jmap -heap 41843

If frequent gc is found to be due to a problem with the size of cenozoic, old-age, or permanent generation allocations, it can be resolved by modifying the settings.

Permanent generation solution: adjust the size of PermSize and MaxPermSize; reduce jar reuse and reuse memory.

Cenozoic, old-age workaround: resize Xms -Xmx -Xmn.

People are sensitive animals to a certain extent, and a good learning atmosphere will urge you to learn and progress to a certain extent. As the saying goes,"choice is greater than effort, persistence is greater than wisdom."

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: 249

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report