CPU Running Status

After Pre-check is complete, perform the following steps to check the CPU status:

  • Command input: Run the top command to query the running status of the system CPU in real time.
    Figure 1 top command execution interface
  • Process thread viewing: To view all threads of a specific process (PID), run the top -H -p <pid> command.
    Figure 2 Viewing a specified process using top
  • Interface operation description:
    • F key: Enter field selection mode.
    • / arrow key: Browse fields.
    • D key: Select or cancel a displayed item.
    • arrow key: Select a field and exchange its sorting position with that of another field.
    • arrow key: Exit the sorting operation.
    Figure 3 Selecting display parameters on the top interface
  • Result analysis and handling:
    • Press F and add the P = Last Used Cpu (SMP) field to view the IDs of the CPU cores that run last for each process.
    • If the CPU cores of a process are switched unexpectedly, the possible causes are as follows: The CPU topology structure of the VM or container is different, or the scope of CPU affinity configuration is too large.
    • For the latter, you can set export CPU_AFFINITY_CONF=2 for fine-grained optimization of CPU affinity configuration.
    Figure 4 Display of the last used CPUs of each process