If the Linux disk is full and the load is too high, the linux disk is overloaded.
1. the disk is full.
If the disk of a machine is full, first determine its location. The command is
Df (or df-h) // display the results Filesystem 512-blocks Used Available Capacity iused ifree % iused Mounted on/dev/disk0s2 488555536 124047536 363996000 26% 15569940 45499500/devfs 25% 361 361 0 100% 626/devmap- hosts 0 0 0 100% 0 100%/net
After finding that disk is full, run the command du level 1 to find the maximum file.
du -h --max-depth=1 | grep 'G' | sort -n
If the log file is too large to be deleted, use Log cutting to keep the latest log.
// Specify the number of lines of files after split-l 300 largelog newlog // specify the size of the split-B 10 m largelog newlog
2. High Load
Run the uptime command to view the server load.
Uptime // output up 1 day, 2 users, load averages: 1.69 2.21 2.09
Average load indicates the average number of processes in the process queue within 1, 5, and 15 minutes. Generally, if a single core is greater than 3, the load is high. Run the following command to view the number of CPUs and cores in linux:
# View the number of physical CPUs cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc-l # view the number of cores in each physical CPU (that is, the number of cores) cat/proc/cpuinfo | grep "cpu cores" | uniq # view the number of logical CPUs cat/proc/cpuinfo | grep "processor" | wc-l
Run the top command to view the CPU and memory usage of each process. The "M" process is sorted by memory usage, and the "P" process is sorted by CPU usage.
If no process occupies a large amount of CPU or memory resources, a process may be blocked. Use ps-ef to see which process will get stuck and find the file corresponding to the process in/proc/to check whether the process can be opened normally.
Find and then kill the process or restart the machine.
3. can't lock/etc/passwd; try again later
First, check whether the lock file exists in/etc,
$ Cd/etc $ ls *. lock $ rm-f *. lock // delete a file lock
If no, use df-I to check whether inode is full. If yes
Find the number of files under each file
for i in ./*; do echo $i; find $i | wc -l |sort -n ; done
Delete useless small files.
We recommend you go to/var/spool/postfix/maildrop to check it out.
To learn more about df-I and df-h, one is how many files can be created in total, and the other is how many large files can be created in total.