Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[ScreenOS] How to debug "session scan" task causing High CPU



Article ID: KB11690 KB Last Updated: 09 Sep 2020Version: 5.0

It is seen that high CPU is being caused by the session scan task. Given this, how can users find the root cause? This article explains how to debug the session scan task when it is resulting in high CPU.



Sometimes, a session scan may cause high task CPU. ScreenOS 6.0.0r2.0 and later provides a debug tool for this session scan task to help find the root cause.



Perform the following commands:

  1. set task "session scan" debug  (to enable session scan debug)
  2. get task "session scan"       

Repeat step 2 several times while CPU is high, in order to identify the sub-task causing the high CPU.

  1. unset task "session scan" debug (to disable session scan debug after finishing debug)

The session scan task has 5 sub-tasks.

Below is an example of session scan task debug.

ns-> get task "session scan"       
id 16, name session scan, seq 16, state NORM
priority NORM , previous priority IDLE
stack size 8192, run time    21217.805
trace: 00373bd4 00972e3c 009733cc
max scheduled interval: 157 ms

Debugged task id list:  16
Task session scan                    debug time:     0 Hour     6 Minutes 54 Seconds

Subtask Name                        RunTime     RunCnt   Schedule   LockLatency
Scan session                         88.131         56       2937        27.111
Route event                           0.000          0          0         0.000
ARP   event                           0.009         42          0         0.000 
NDP                                   0.000          0          0         0.000
PMTU                                  0.000          0          0         0.000
All subtasks  used CPU time          88.140          lock latency        27.111
Debugged task used CPU time          89.051          lock latency        27.484
  1. The 'debug time' field in above command output shows how long the task has been debugged.

  2. Each subtask has 5 attributes:

  • Name:  Subtask name

  • Runtime: Subtask's CPU time consumption (in seconds)

  • RunCnt:  Subtask's execution count

  • Schedule: Subtask can pause execution and resume execution after a period of time. This value specifies how many above cases happened during the subtask's execution.

  • LockLatency: For high end platforms with dual CPUs, task CPU may share resources with flow CPU and spinlock is introduced to keep exclusive access of shared resources. Spinlock can be CPU-consuming. This value specifies how much CPU time (in seconds) is spent on spinlock. LockLatency time is a subset of Runtime.

  1. This example shows that ARP task is the main cause of high CPU because multiple executions of this command shows that ARP task RunCnt increases frequently. Therefore, check for ARP problems.


Modification History:

2020-09-09: Article reviewed for accuracy; [ScreenOS] added to title; no other changes made; article valid and accurate


Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search