Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Check the Routing CPU Memory Usage

 

Purpose

Software processes on the router can consume a considerable amount of CPU and memory. The routing protocol process (rpd) can consume enormous amounts of memory to store information needed for the operation of routing and related protocols, such as Border Gateway Protocol (BGP), Open Shortest Path First (OSPF), Intermediate System-to-Intermediate System (ISIS), Resource Reservation Protocol (RSVP), Label Distribution Protocol (LDP), and Multiprotocol Label Switching (MPLS).

To verify the traffic passing through the router and check memory utilization, follow these steps:



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 top command. However, the UNIX top command shows real-time memory usage, with the memory values constantly changing, while the show system processes extensive command provides a snapshot of memory usage in a given moment.

Action

To check overall CPU and memory usage, enter the following Junos OS command-line interface (CLI) command:

Sample Output

user@R1> show system processes extensive

Meaning

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 processes field shows that most of the 58 processes are in the sleeping state, with 1 in the running state. The process or command that is running is the top command.

The commands column 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 become Inactive, Cache, or Free, 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 Swap field 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 SIZE field indicates the size of the virtual address space, and the RES field 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.



Check Routing Protocol Process (rpd) Memory Usage

Purpose

When you notice a lot of memory usage, you can obtain detailed information about the memory utilization of routing tasks to get an idea of what is going on. The routing process (rpd) is the main task that uses Routing Engine memory.

Action

To check routing process memory usage, enter the following Junos OS CLI operational mode commands:

Sample Output

user@host> show route summary

Meaning

The sample output shows summary statistics about the entries in the routing table (show route summary command) and the memory usage breakdown (show task memory detail command) for the routing process (rpd). The two commands provide a comprehensive picture of the memory utilization of the routing protocol process.

The show route summary command shows the number of routes in the various routing tables. In the sample output, the routing tables represented are inet.0, inet.2, inet.3, iso.0, and mpls.0. Within each routing table, all of the active, hold-down, and hidden destinations and routes are summarized for all the protocols from which routes are learned. Routes are in the hold-down state prior to being declared inactive, and hidden routes are not used because of routing policy. Routes in the hold-down and hidden states are still using memory because they appear in the routing table.

In addition, routes are summarized in the following categories: those directly connected to the network (Direct), local routes (Local), and routes learned from configured routing protocols, such as BGP and IS-IS.

The show task memory detail command lists the data structures within the tasks run by the routing protocol process (rpd). Tasks are enabled depending on the router’s configuration. For example, isis_area_addr is a data structure resulting from the IS-IS configuration. The AllocBytes field indicates the highest amount of memory used by the data structure. For example, the isis_area_addr data structure has 544 blocks of allocated memory, each block is allocated a value of 16 bytes, resulting in allocated bytes of 8704. The maximum allocated blocks and bytes are high-water marks for a data structure. For more information on displaying task-related information, see Display Tasks.

The Total bytes in use field shows the total amount of memory used by the routing protocol process (rpd).



Display Tasks

Purpose

You can display information about tasks to further your investigation of a memory problem on the router.

Action

To display a list of tasks that are enabled on the router, enter the following Junos OS CLI operational mode commands:

Sample Output

user@R1> show task

Meaning

The sample output shows a list of routing, routing protocol, and interface tasks that are currently running on the router (show task), a summary of memory utilization (show task memory), and the memory utilization of a particular task (show task io). Tasks can be baseline tasks performed regardless of the router configuration, and other tasks that depend on the router configuration. For example, the BGP_Group_internal task is the result of the configuration of BGP on the router, while the INET6 task is a base task associated with the routing process (rpd).

Each task in the show task command output has a priority and a task name. For example, the current priority is 10 for LMP Client and 80 for IF Delete. A lower number indicates a higher priority.

Some tasks have flags attached to them. For example, the BGP.0.0.0.0+179 task has two flags, Accept and LowPrio. The Accept flag indicates that the task is waiting for incoming connections, and the LowPrio flag indicates that the task will be dispatched to read its socket after other, higher priority tasks. Two additional flags are Connect, which indicates that a task is waiting for a connection to complete, and Delete, which indicates that a task has been deleted and is being cleaned up.

The show task io command shows the statistics gathered for each IO operation. The counters show the following:

  • Reads—This counter increments when a datagram arrives on a connected socket of the task and the task’s read callback is called.

  • Writes—This counter increments when a connected socket of a task becomes writable and the tasks’s callback is called.

  • Rcvd—This counter increments when the task calls the Routing Engine to read a datagram from a socket which may or may not be connected.

  • Sent—This counter increments when a task attempts to read or write a datagram on an existing or nonexisting socket.

  • Drops—This counter increments when a task attempts to read or write a datagram through the Routing Engine on a prebuilt socket, but the request fails for any reason.