Octet

A router's CPU is at 99 percent. How do you find out why?

Show the answer

Say this first

show processes cpu sorted first, and show processes cpu history to see whether it is constant or spiky. On classic IOS the header splits the 5-second figure, for example 99%/85%: the second number is time spent at interrupt level, so a high value means packets are being switched in software. If one process tops the list, its name points the way: IP Input means packets punted for process switching, ARP Input an ARP storm, BGP Router routing churn, SNMP ENGINE heavy polling. Then I find the punted traffic and stop it.

Go deeper

Output
R1# show processes cpu sorted
CPU utilization for five seconds: 99%/85%; one minute: 96%; five minutes: 94%
 PID Runtime(ms)     Invoked      uSecs   5Sec   1Min   5Min TTY Process
  89     9873211    41920334        235 12.47% 10.31%  9.88%   0 IP Input

85 percent at interrupt level plus IP Input near the top: a lot of traffic is not being forwarded in the fast path.

Reading the clues

ClueLikely causeNext step
IP Input highpackets punted: TTL expiring in a loop, IP options, traffic to the router itself, ACL lines with logshow interfaces stats for process-switched counts, show ip traffic
ARP Input highARP storm or scan, or a static route pointing out an Ethernet interface with no next hopshow ip arp summary, broadcast counters
BGP Router, OSPF processeschurn from a flapping peer or linkshow ip bgp summary, show ip ospf statistics
SNMP ENGINEa poller walking a big table too oftenfind the poller, slow it down
Exec, Virtual Execheavy commands, or debug left runningshow users, undebug all

IOS-XE platforms

On ISR 4000, ASR 1000 and Catalyst 9000, forwarding happens in a separate data plane (the QFP on the routers, the UADP ASIC on the switches), and show processes cpu sorted covers the IOSd control plane. show processes cpu platform sorted shows the underlying Linux processes. High CPU there usually means punted traffic, and the platform punt statistics show which cause is hot.

Protect the control plane

  • CoPP to cap punted traffic per class.
  • Remove log from busy ACL lines, fix loops, and point static routes at a next hop, not just an interface.
  • Never leave a debug running on a busy production device.

Traps

  • Running debug ip packet on a router that is already at 99 percent CPU.
How did you do?