Technical Tip: How to find out which process runs on which CPU core
Description
This article describes the way to find out which process runs on which CPU core.
Scope
FortiGate.
Solution
- Access to the FortiGate via SSH.
- Execute a CLI command to see the process list on the CLI.
diagnose sys top
(global) # diagnose sys top
Run Time: 0 days, 7 hours and 50 minutes
0U, 0N, 0S, 100I, 0WA, 0HI, 0SI, 0ST; 2012T, 681F
ipshelper 314 S < 0.0 3.9
cmdbsvr 124 S 0.0 3.3
ipsengine 315 S < 0.0 3.0
httpsd 379 S 0.0 3.0
miglogd 144 S 0.0 2.4
pyfcgid 284 S 0.0 2.3
httpsd 209 S 0.0 2.2
httpsd 380 S 0.0 2.0
reportd 163 S 0.0 2.0
httpsd 317 S 0.0 1.8
pyfcgid 286 S 0.0 1.8
forticron 155 S 0.0 1.7
httpsd 656 S 0.0 1.6
cw_acd 180 S 0.0 1.4
httpsd 1338 S 0.0 1.4
miglogd 196 S 0.0 1.4
-
Two examples are to find out which process runs on which CPU core, based on the above process lists.
ipsengine.
diagnose sys process dump 315 | grep Cpu <---- 315 is the Process ID(PID) of a daemon/process.
Cpus_allowed: 1 <---- 0001 (converted by binary).
Cpus_allowed_list: 0 <---- CPU no. 0 (1st from the far right is '1').
miglogd.
diagnose sys process dump 196 | grep Cpu
Cpus_allowed: 2 <----- 0010 (converted by binary).
Cpus_allowed_list: 1 <----- CPU no. 1 (2nd from the far right is '1').
In v7.0 and later versions, the core details can be directly seen from the diagnose sys top output.
diagnose sys top
Run Time: 31 days, 18 hours and 12 minutes
0U, 0N, 0S, 100I, 0WA, 0HI, 0SI, 0ST; 2007T, 663F
cmdbsvr 145 S 4.0 2.7 0 --> CPU core 0.
node 28235 S 3.3 2.5 1 --> CPU core 1.
updated 194 R 2.1 1.7 4
reportd 190 S 6.0 1.5 3
cw_acd 211 S 6.3 1.4 2
forticron 180 S 2.7 1.3 3
miglogd 189 R 1.1 1.3 1
autod 215 S 5.8 1.2 4
In the above command, the 4th column shows CPU, and the 5th row shows memory.
Related article:
Technical Tip: Resolve '502 Bad Gateway' error during FortiWeb-OCI server policy deployment
