Background: Sometimes you need to look at the CPU and occupancy of a process, sometimes you need to look at a single occupancy of the overall process. I. Linux PS command to view CPU and memory usage of a process [[emailprotected] vhost]# PS aux user pid%
Problem:Run the vmstat, top, and PS aux commands to view the CPU usage of the process. The value varies greatly.
Example:Use vmstat to view the system's CPU idle rate. The ID is the CPU idle rate. It can be seen that the idle rate is always above 73%.Use
About the inconsistent CPU usage of the Vmstat,top,ps aux viewProblem:Use the vmstat,top, and PS aux three commands to see the CPU occupancy rate of the process, the value varies greatly.Cases:Use Vmstat to view the system CPU idl
display of DataView is inaccurate.Workaround (Pending validation):1. Use the built-in Zabbix variable proc.cpu.util[2. Modify the commands in the script, using the following method instead:First, get the PID of the process name, and then combine top to run the following command:Top-b-n 1-p $pid 2>1 | Awk-v pid= $pid ' {if (= = pid) print $9} '3. Modify the commands in the script, using the following method instead:The PID of the process name is obtained first, and then the relevant data is read
Linux ps command to view the cpu and memory usage sorting (conversion), linuxps
Run the following command to View Details:
ps -aux | sort -k4,4nps auxw --sort=rssps auxw --sort=%cpu
Ps commands in linux
%
Run the following command to View Details:PS-Aux | sort-K4, 4n
PS auxw -- Sort = RSS
PS auxw -- Sort = % CPU
PS commands in Linux
% CPU usage of CPU Processes% Mem process memory usageT
This series of articles will introduce Docker knowledge:
(1) Docker installation and basic usage
(2) Docker mirror
(3) Isolation of Docker containers-use Linux namespace isolate container's operating environment
(4) Isolation of Dock
search the Docker Hub for images tag tag an image into a repository save one or more images to a tar archive (streamed to STDOUT by default) history show the history of a Mirror Insp ECT get the details of the mirror container and the lifecycle operations it applies to: create Create a new container (creating a container) kill kill one or more running Containers Insp
ECT return low-level information on a container, image or task pause pause all proc
Basic knowledge and usage of docker, basic knowledge of dockerWhat is docker
DockerIs a container engine that provides a complete set of container solutions. It is the hottest open-source project in 2014, based on the Apache2.0 open source protocol, developed by Go language.What is container
Containers have a long history. Linux LXC and Solaris Zones are differe
install another tool nsenter, which can access the container spaceInstall this tool: Yum install Util-linuxWe first get the PID of this container
[Root@zabbix-3 ~]# Docker inspect--format ' {{. State.pid}} "Mynginx8085Then mount and mount the parameters into the container
[Root@zabbix-3 ~]# nsenter--target 8085--mount--uts--ipc--net--pidroot@5643fa5e6925:/# PS auxUSER PID%
reopen the Quick start terminal.Ii. Methods of UseAfter installing Docker and preparing the environment, open the Docker QuickStart terminal to start the Docker runtime environment.First, let's check to see if Docker is installed correctly with the following command:Docker infoIf this command is not found,
reopen the Quick start terminal.Ii. Methods of UseAfter installing Docker and preparing the environment, open the Docker QuickStart terminal to start the Docker runtime environment.First, let's check to see if Docker is installed correctly with the following command:Docker infoIf this command is not found,
running, use ctrl+p when exiting, and then use Ctrl+q) dockerevents --since=20151118 #查看直到指定日期容器的实时系统事件docker logsCONTAINER_ID #批量打印出容器中进程的运行日志docker waitCONTAINER_ID #阻塞一个容器 until the container stops (PS: I don't know how to use it at the moment) dockerexportcontainer_id> /directory/container.tar# (saves state information for a current container), import can us
for the container, so when the process is finished, the container will stop completely.# Run the "echo" command in the container and output "Hello word"$docker run image_name echo "Hello word"# Interactive entry into the container$docker run-i-T Image_name/bin/bash# Install a new program in the container$docker run image_name apt-get install-y app_nameNote: When
usage size h-show help n-set the number of processes displayed in the process List q-exit tops-change screen update cycle part 3-process in the bottom list bar: the process list differentiated by PID is regularly updated based on the set screen update time. You can use the top internal command to control the display mode. In general, we maintain the server through remote monitoring, so that the local terminal of the server runs top in real time, whic
Linux provides top, PS commands to view current CPU, mem usage, briefly described as follows:One, using the PS view process resource consumptionPs-auxWhen you view process information, the third column is CPU consumption.[Email protected] utx86]#
Linux is available under the top, PS command to check the current CPU, mem usage. Here's a simple example:First, using PS to view the process of resource consumptionPs-auxWhen you view the process information, the third column is the CPU check-in.[Email protected] utx86]#
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.