show region >>>>>获取tarting address, the ending address and the> show memory statistics >>>>>检查处理器内存中最大的块的大小。
profile task interrupt (隐藏命令)>>>>>仅配置中断的配置文件。
比较main:text区域的大小和空闲处理器largest block的大小。 理想情况下,largest block应该比main:text大。
如果largest block比main:text小的话,然后调整粒度以确保分析将能够获得一块处理器内存。
如果largest block比main:text大的话,使用粒度4.
如果largest block比main:text大一半的话,使用粒度8.
如果largest block比main:text大四分之一的话,使用粒度10 (16 in hexadecimal)
注意:粒度必须是2的幂,并应尽可能小(但不能小于4)
通过执行配置文件开始分析
Profile <starting address> <ending address> <granularity value>
起始地址和结束地址由Step1确定。
等待5到10分钟
停止配置文件通过profile stop
捕获显示配置文件通过show profile terse
确保所有内存都被释放unprofile all
@show interfaces switching命令
该命令用于确定接口上的主用交换路径。
例如:
R1#sho interfaces switching
Ethernet0/0
Throttle count 0
Drops RP 0 SP 0
SPD Flushes Fast 0 SSE 0
SPD Aggress Fast 0
SPD Priority Inputs 3 Drops 0
Protocol IP
Switching path Pkts In Chars In Pkts Out Chars Out
Process 1004 114456 1004 114456
Cache misses 0 - - -
Fast 0 0 0 0
Auton/SSE 0 0 0 0
Protocol DEC MOP
Switching path Pkts In Chars In Pkts Out Chars Out
Process 17 1309 17 1309
Cache misses 0 - - -
Fast 0 0 0 0
Auton/SSE 0 0 0 0
Protocol ARP
Switching path Pkts In Chars In Pkts Out Chars Out
Process 3 180 3 180
Cache misses 0 - - -
Fast 0 0 0 0
Auton/SSE 0 0 0 0
Protocol CDP
Switching path Pkts In Chars In Pkts Out Chars Out
Process 176 59312 176 59312
Cache misses 0 - - -
Fast 0 0 0 0
Auton/SSE 0 0 0 0
Protocol Other
Switching path Pkts In Chars In Pkts Out Chars Out
Process 0 0 1041 62460
Cache misses 0 - - -
Fast 0 0 0 0
Auton/SSE 0 0 0 0
NOTE: all counts are cumulative and reset only after a> Interface Ethernet0/1 is disabled
Interface Ethernet0/2 is disabled
Interface Ethernet0/3 is disabled
输出列出了接口上配置的所有协议的交换路径,因此您可以轻松地看到路由器通过什么类型和数量的流量。 下表解释了输出字段:
4、当在CISCO 7600 Series Router上开启Netflow NDE时High CPU
如果NetFlow配置为版本7,则流量由路由处理器执行,这可能会导致高CPU使用率。
要排除由于Netflow版本7而导致的高CPU使用率故障,请配置mls nde sender版本5,因为Netflow导出由SP(默认版本5或版本9)执行。
5、进程导致的High CPU
检查哪个进程正在加载CPU。与进程相关的异常活动会在日志中产生错误消息。因此,应首先检查show logging的输出,以确定与耗费大量CPU周期的进程相关的任何错误。
debug也可以帮助解决进程中CPU利用率高的问题。不过,应该非常小心的进行调试,因为它可能会提高CPU利用率。为了使debug安全有用,应该满足这些先决条件:
除缓冲区日志记录以外的所有日志记录目标都应该禁用,或者使用相应的logging destination [severity-level]配置命令将其日志严重性级别从7(调试)降至6(信息)或更低。
ARP Input—ARP Input section of the document Troubleshooting High CPU Utilization Due to Processes
BGP Router—High CPU due to BGP Router Process section of the document Troubleshooting High CPU Caused by the BGP Scanner or BGP Router Process
BGP Scanner—High CPU due to BGP Scanner section of the document Troubleshooting High CPU Caused by the BGP Scanner or BGP Router Process
EXEC—High CPU Utilization in the EXEC and Virtual EXEC Processes
HyBridge Input—Troubleshooting High CPU Utilization Caused by the HyBridge Input Process on Routers With ATM Interfaces
IP Input—Troubleshooting High CPU Utilization Due to the IP Input Process
IP Simple Network Management Protocol (SNMP)—IP Simple Network Management Protocol (SNMP) Causes High CPU Utilization
LC ADJ Updater—What Causes High CPU Utilization in the LC Adjacency Updater Process on a Cisco 12000 Series Internet Router?
TCP Timer—TCP Timer section of the document Troubleshooting High CPU Utilization due to Processes
TTY Background—TTY Background section of the document Troubleshooting High CPU Utilization due to Processes
Virtual EXEC—High CPU Utilization in Exec and Virtual Exec Processes
Vtemplate Backgr—Virtual Template Background section of the document Troubleshooting High CPU Utilization due to Processes
SSH Process— Might go high if capturing a show tech or some debug is enabled.
Other processes—Other Processes section of the document Troubleshooting High CPU Utilization due to Processes
6、软件加密导致的High CPU
当设备中没有安装硬件加密模块时,所有通过设备的加密流量都必须由软件加密。 这是非常密集的CPU。 不建议对具有合理吞吐量要求的任何加密部署使用软件加密。 解决此问题的一个选项是减少加密流量(重新路由流量或限制加密的流量)。 但是,解决此问题的最佳方法是为此设备安装硬件加密模块,从而消除了通过软件进行加密的需要。
注意:启用隧道/物理接口上的加密映射是一个内存消耗过程,可能会导致CPU的增加。
7、由于分片/碎片的导致的High CPU
如果CPU需要重新组装大量的数据包,重新组装可以使CPU运转得非常高。
要排除因碎片导致的高CPU占用率,请在接口上发出tcp mss-adjust 1400命令,该命令设置通过路由器的TCP同步/启动(SYN)数据包的最大段大小(MSS)值。
8、获取更多信息的命令
如下命令可以为问题提供更多的信息供分析:
show processes cpu
show interfaces
show interfaces switching >>>>>determining active switching paths on interfaces
show interfaces stat >>>>>is a summarized version of the show interfaces switching command
show ip nat translations >>>>>displays the Network Address Translation (NAT) translations active on the router
show align >>>>> only on reduced instruction set computing (RISC) processor-based platforms
show version >>>>> Cisco IOS Software version, platform, CPU type, and the uptime of the router.
show log >>>>>more information about logging system messages
对于show ip nat translations,每个活动NAT都会产生CPU中断,并影响路由器的总CPU利用率。 大量的NAT可能会对路由器产生性能影响。
如果路由器完全无法访问,请首先重新启动路由器。 然后,定期收集本节中除了show log(show log 应该在syslog server上)命令的输出。
#show process cpu#
CPU utilization for five seconds: X%/Y%; one minute: Z%; five minutes: W%
PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process
注意:总CPU利用率不应该用来衡量路由器交换更多数据包的能力。 在Cisco 7500路由器上,多功能接口处理器(VIP,Versatile Interface Processors)和路由/交换处理器(RSP,Route/Switch Processors)不报告线性CPU利用率。 接近一半每秒切换数据包的功率来自90%到95%的CPU利用率。
原话如下:
Note: Total CPU utilization should not be used as a measure of the ability of the router to switch more packets. On Cisco 7500 routers, Versatile Interface Processors (VIPs) and Route/Switch Processors (RSPs) do not report linear CPU utilization. Close to half of the switching packet-per-second power comes after 90 to 95 percent CPU utilization.
相关原文链接:
https://www.cisco.com/c/en/us/support/docs/routers/10000-series-routers/15095-highcpu.html?referring_site=bodynav#show_process_cpu