Step 1: Check Overall CPU and Memory Usage
Purpose
You can display exhaustive system process information about software processes that are running on the router and have controlling terminals. This command is equivalent to the UNIX
topcommand. However, the UNIXtopcommand shows real-time memory usage, with the memory values constantly changing, while theshow system processes extensivecommand provides a snapshot of memory usage in a given moment.Action
To check overall CPU and memory usage, enter the following JUNOS command-line interface (CLI) command:
user@host>show system processes extensiveSample Output
user@R1>show system processes extensivelast pid: 5251; load averages: 0.00, 0.00, 0.00 up 4+20:22:16 10:44:4158 processes:1 running, 57 sleepingMem: 57M Active, 54M Inact, 17M Wired, 184K Cache, 35M Buf, 118M FreeSwap:512M Total, 512M FreePID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND4480 root 2 0 3728K 1908K select 231:17 2.34% 2.34% chassisd4500 root 2 0 1896K 952K select 0:36 0.00% 0.00% fud4505 root 2 0 1380K 736K select 0:35 0.00% 0.00% irsd4481 root 2 0 1864K 872K select 0:32 0.00% 0.00% alarmd4488 root 2 0 8464K 4600K kqread 0:28 0.00% 0.00% rpd4501 root 2 -15 1560K 968K select 0:21 0.00% 0.00% ppmd4510 root 2 0 1372K 812K select 0:13 0.00% 0.00% bfdd5 root 18 0 0K 0K syncer 0:09 0.00% 0.00% syncer4485 root 2 0 3056K 1776K select 0:07 0.00% 0.00% snmpd4499 root 2 0 3688K 1676K select 0:05 0.00% 0.00% kmd4486 root 2 0 3760K 1748K select 0:05 0.00% 0.00% mib2d4493 root 2 0 1872K 928K select 0:03 0.00% 0.00% pfed4507 root 2 0 1984K 1052K select 0:02 0.00% 0.00% fsad4518 root 2 0 3780K 2400K select 0:02 0.00% 0.00% dcd8 root -18 0 0K 0K psleep 0:02 0.00% 0.00% vmuncachedaemo4 root -18 0 0K 0K psleep 0:02 0.00% 0.00% bufdaemon4690 root 2 0 0K 0K peer_s 0:01 0.00% 0.00% peer proxy4504 root 2 0 1836K 968K select 0:01 0.00% 0.00% dfwd4477 root 2 0 992K 320K select 0:01 0.00% 0.00% watchdog4354 root 2 0 1116K 604K select 0:01 0.00% 0.00% syslogd4492 root 10 0 1004K 400K nanslp 0:01 0.00% 0.00% tnp.sntpd4446 root 10 0 1108K 616K nanslp 0:01 0.00% 0.00% cron4484 root 2 0 15716K 7468K select 0:01 0.00% 0.00% mgd4494 root 2 15 2936K 2036K select 0:01 0.00% 0.00% sampled5245 remote 2 0 8340K 3472K select 0:01 0.00% 0.00% cli2 root -18 0 0K 0K psleep 0:00 0.00% 0.00% pagedaemon4512 root 2 0 2840K 1400K select 0:00 0.00% 0.00% l2tpd1 root 10 0 852K 580K wait 0:00 0.00% 0.00% init5244 root 2 0 1376K 784K select 0:00 0.00% 0.00% telnetd4509 root 10 0 1060K 528K nanslp 0:00 0.00% 0.00% eccd4508 root 2 0 2264K 1108K select 0:00 0.00% 0.00% spd2339 root 10 0 514M 17260K mfsidl 0:00 0.00% 0.00% newfs4497 root 2 0 2432K 1152K select 0:00 0.00% 0.00% cosd4490 root 2 -15 2356K 1020K select 0:00 0.00% 0.00% apsd4496 root 2 0 2428K 1108K select 0:00 0.00% 0.00% rmopd4491 root 2 0 2436K 1104K select 0:00 0.00% 0.00% vrrpd4487 root 2 0 15756K 7648K sbwait 0:00 0.00% 0.00% mgd5246 root 2 0 15776K 8336K select 0:00 0.00% 0.00% mgd0 root -18 0 0K 0K sched 0:00 0.00% 0.00% swapper5251 root 30 0 21732K 840K RUN 0:00 0.00% 0.00% top4511 root 2 0 1964K 908K select 0:00 0.00% 0.00% pgmd4502 root 2 0 1960K 956K select 0:00 0.00% 0.00% lmpd4495 root 2 0 1884K 876K select 0:00 0.00% 0.00% ilmid4482 root 2 0 1772K 776K select 0:00 0.00% 0.00% craftd4503 root 10 0 1040K 492K nanslp 0:00 0.00% 0.00% smartd6 root 28 0 0K 0K sleep 0:00 0.00% 0.00% netdaemon4498 root 2 0 1736K 932K select 0:00 0.00% 0.00% nasd4506 root 2 0 1348K 672K select 0:00 0.00% 0.00% rtspd4489 root 2 0 1160K 668K select 0:00 0.00% 0.00% inetd4478 root 2 0 1108K 608K select 0:00 0.00% 0.00% tnetd4483 root 2 0 1296K 540K select 0:00 0.00% 0.00% ntpd4514 root 3 0 1080K 540K ttyin 0:00 0.00% 0.00% getty4331 root 2 0 416K 232K select 0:00 0.00% 0.00% pccardd7 root 2 0 0K 0K pfeacc 0:00 0.00% 0.00% if_pfe_listen11 root 2 0 0K 0K picacc 0:00 0.00% 0.00% if_pic_listen3 root 18 0 0K 0K psleep 0:00 0.00% 0.00% vmdaemon9 root 2 0 0K 0K scs_ho 0:00 0.00% 0.00% scs_housekeepi10 root 2 0 0K 0K cb-pol 0:00 0.00% 0.00% cb_pollWhat It Means
The sample output shows the amount of virtual memory used by the Routing Engine and software processes. For example, 118 MB of physical memory is free and 512 MB of the swap file is free, indicating that the router is not short of memory. The
processesfield shows that most of the 58 processes are in thesleepingstate, with 1 in therunningstate. The process or command that is running is thetopcommand.The
commandscolumn lists the processes that are currently running. For example, the chassis process (chassisd)has a process identifier (PID) of 4480, with a current priority (PRI) of 2. A lower priority number indicates a higher priority.The processes are listed according to level of activity, with the most active process at the top of the output. For example, the chassis (chassisd) process is consuming the largest amount of CPU resource at 2.34 percent.
The memory field (
Mem) shows the virtual memory managed by the Routing Engine and used by processes. The value in the memory field is in KB and MB, and is broken down as follows:
Active—Memory that is allocated and actually in use by programs.Inact—Memory that is either allocated but not recently used or memory that was freed by programs. Inactive memory is still mapped in the address space of one or more processes and, therefore, counts toward the resident set size of those processes.Wired—Memory that is not eligible to be swapped, and is usually used for Routing Engine memory structures or memory physically locked by a process.Cache—Memory that is not associated with any program and does not need to be swapped before being reused.Buf—The size of the memory buffer used to hold data recently called from disk.Free—Memory that is not associated with any programs. Memory freed by a process can becomeInactive,Cache, orFree, depending on the method used by the process to free the memory.When the system is under memory pressure, the pageout process reuses memory from the free, cache, inactive and, if necessary, active pages.
The
Swapfield shows the total swap space available and how much is unused. In the example, the output shows 512 MB of total swap space and 512 MB of free swap space.Finally, the memory usage of each process is listed. The
SIZEfield indicates the size of the virtual address space, and theRESfield indicates the amount of the program in physical memory, which is also known as RSS or Resident Set Size. In the sample output, the chassis (chassisd) process has 3728 KB of virtual address space and 1908 KB of physical memory.For additional information about the
show system processes extensivecommand, see Stop and Start JUNOS Software.