Load is used to measure the workload of a server; that is, the length of the queue of tasks to be executed by the CPU. The greater the value, the more processes that are currently running or waiting to be executed.
You can run the w
, top
, uptime
, and procinfo
commands or access the /proc/loadavg
file to view the load.
Please refer to "Installing Software in the Linux Environment" for instructions on how to install the procinfo tool.
The server load/load average is displayed based on the length of the process queue. A high server load (we recommend referencing the 15-minute average) may be caused by insufficient CPU resources, I/O read/write bottlenecks, insufficient memory resources, or intensive computing tasks. We recommend you run the vmstat
, iostat
, and top
commands to identify the reason for the high load and optimize the processes.
You can check the server memory usage by running the free
, top
(after running, you can press shift+m
to sort the memory), vmstat
, and procinfo
commands or by accessing the /proc/meminfo
file.
You can check the memory usage of a single process by running the top -p PID
, pmap -x PID
, and ps aux|grep PID
commands or by accessing the /proc/$process_id (process PID) /status
file (for example, the /proc/7159/status
file).
You can check the services and ports that are currently in use by running the netstat -tunlp
, netstat -antup
, and lsof -i:PORT
commands.
You can check the server process information by running the ps auxww|grep PID
, ps -ef
, lsof -p PID
, and top -p PID
commands.
You can run kill -9 PID
(PID indicates the process ID) and killall program name
(for example, killall cron) to stop a process.
To stop a zombie process, you need to kill the parent process by running kill -9 ppid
(ppid indicates the parent process ID, which can be queried by running ps -o ppid PID
(for example, ps -o ppid 32535)).
You can run top
to view the total of zombie processes, and run ps -ef | grep defunct | grep -v grep
to locate a specific zombie process.
You need to check the operating system and the application to ensure a port is enabled.
Only the root
user can enable ports below 1024 on the Linux operating system. Run sudo su -
to obtain root permissions before enabling the server port.
For application issues such as port conflicts or configuration problems, use the application startup logs to troubleshoot them. The Tencent server system uses port 36000.
Command Name | Description |
---|---|
top | top is a task manager program that monitors the overall performance of the system. This command can be used to display information such as the system load, the process, the CPU, the memory, and paging. Use `shift+m` and `shift+p` to sort the processes by memory usage and CPU usage. |
vmstat | vmstat is a computer system monitoring tool mainly used for virtual memory that collects and displays summary information about CPU, processes, memory paging, and IO. For example, vmstat 3 10 outputs results every 3 seconds and is executed 10 times. |
iostat | iostat is a computer system monitoring tool that collects and displays statistics about CPU and IO. For example, iostat -dxmt 10 outputs detailed information about IO in MB every 10 seconds. |
df | df is a command used to display the amount of available disk space. For example: df -m displays the disk space usage in MB. |
lsof | lsof reports a list of all open files, which is very useful for Linux system management. For example: |
ps | ps is a process query command that displays information related to the processes. Commonly used command parameter combinations are `ps -ef` and `ps aux`. Use `ps -A -o` to output custom fields. |
Other commonly used commands and files: free -m
, du
, uptime
, w
, /proc/stat
, /proc/cpuinfo
, and /proc/meminfo
.
Follow the steps below to troubleshoot this problem:
crontab -e
to add the following test item.\*/1 \* \* \* \* /bin/date >> /tmp/crontest 2>&1 &
/tmp/crontest
file.ps aux|grep cron
to look for the pid of cron, run kill -9 PID
to terminate the cron process, and then run /etc/init.d/cron start
to restart cron. /etc/cron.deny
.\*/1 \* \* \* \* /bin/date >> /tmp/crontest 2>&1 &
.The Linux kernel startup sequence is as follows:
/sbin/init
process./etc/rc.d/rc\*.d
, where the value of * means the running mode, which can be queried in /etc/inittab
./etc/rc.d/rc.local
.Note:
The startup task can be configured in
/etc/rc.d/rc.local
or in theS\*\*rclocal
file in/etc/rc.d/rc\*.d
.
Common reasons for a read-only server disk are as follows:
df -m
to check the disk usage and then delete unnecessary files to free disk space. (We do not recommend you delete non-third party files. Please check the files before you delete them). df -i
to view and confirm relevant processes. If none of the above works, please call the hot line or submit a ticket.
/var/log
./var/log/messages
.You can find them by following the steps below:
df
to query the disk partition usage (for example, df -m
).du
to query the size of a specific folder (for example, du -sh ./\*
, du -h --max-depth=1|head -10
).ls
to list the files and file sizes (for example, ls -lSh
).find
command (for example, find / -type f -size +10M -exec ls -lrt {} \
).You can run the following commands to check the version of a server’s operating system:
The server itself does not impose restrictions on the display language. Therefore, this is most likely a client problem. If you are using secureCRT, try to change the settings in Options -> Session Options -> Appearance. If you are using other terminal software, please search on Google for solutions.
If this problem appears in a pure Linux shell, run export
to check the user environment variables such as LANG and LC_CTYPE.
You can configure the following settings so that the connection to your CVM instance remains stable when connecting to CVM via SecureCRT:
Cause:
After logging in to your Linux CVM instance and deleting a file using rm
, you may find that the available disk space does not increase when you use df
to check the disk space. This is because when the file is deleted, if another process happens to be accessing the file, the space occupied by the deleted file will not be immediately freed at the time you check the disk space.
Solution:
lsof |grep deleted
using the root permission and find the PID of the process that is using the deleted file.kill -9 PID
. You can run rm
to delete files. Files deleted with this command cannot be recovered. Therefore, please use this command with caution.
Format of rm
: rm (option) (parameter)
.
-r
or -R
option.rm test.txt
to delete the test.txt
file.rm -r test
to delete the test
directory.rm -r *
to delete all files and sub-directories under the current directory.
Was this page helpful?