您的位置:首页 > 其它

路由器CPU过高

2010-08-07 20:34 260 查看
1.

出口路由器配置及功能:


cisco 2611XM,128M内存,2个FE、1个同步串口。

外网出口,配置有NAT转换。

2.

故障现象:

间隔三、五天弱规律性地出现出口路由器高CPU利用率过高造成死机故障,关机重启后恢复正常,三、五天后故障依旧。

3.

故障排错过程:

3.1.

要求用户尽可能地在故障发生前抓系统信息,以便分析。

Show tech

[align=center] [/align]

通过使用show process memory 查看内存占用情况

――我们发现故障发生时内存占用率并不是很高,因此用户要求升级内存容量不会对解决故障产生好的影响。

Total: 78372504, Used: 17315700, Free: 61056804



通过使用show process cpu 察看进程CPU占用

――CPU利用率已达到100%,造成系统处理性能严重下降,最终会造成死机。

如下图红色框所示:我们可以清楚地看到IP NAT进程仅占用不到9%CPU资源,将近85%CPU资源全部被IP INPUT进程所占用。从上可以判断NAT地址翻译不是造成高CPU的主要原因。

针对IP INPUT进程造成高CPU的故障思科有专门的分析文档可参考,具体链接地址如下:http://www.cisco.com/en/US/products/hw/routers/ps359/products_tech_note09186a00801c2af3.shtml

IP Input进程主要用于以进程交换方法进行数据包处理(process-switching),如果IP Input使用了太多的CPU资源,这意味着路由器使用进程交换算法处理了大量IP数据包。

当前主要的数据包交换算法有进程交换和快速交换等,主要不同在于路径查找方式或者说是效率上。进程交换(process-switching)是最早的路由查找方法,是对整个路由表进行最长匹配查找,因此是最CPU资源敏感的交换方法。而快速交换(fast-switching)是优化后的路由查找方法,是对活跃的流建立交换缓存。这些活跃的流中的目的地址通常只是路由表的一个子集,对数据包先查找交换流缓存表(查找时间相对固定),如果找到了,就按其做转发,如果没找到,再进行进程交换,并同时建立一个流缓存条目。 所以,快速交换使用的数据库是动态的,实际上反映了经过本地路由器的流的状况。 为了避免CPU利用率过高,当前在路由器上都建议打开快速交换(fast-switching)。

------------------ show process cpu ------------------

CPU utilization for five seconds: 100%/5%; one minute: 99%; five minutes: 99%

PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process

1 2982 14436 206 0.07% 0.01% 0.00% 0 Load Meter

3 107993 9196 11743 0.00% 0.09% 0.06% 0 Check heaps

4 0 1 0 0.00% 0.00% 0.00% 0 Chunk Manager

5 765 878 871 0.00% 0.00% 0.00% 0 Pool Manager

6 0 2 0 0.00% 0.00% 0.00% 0 Timers

7 0 2 0 0.00% 0.00% 0.00% 0 Serial Backgroun

8 372 11184 33 0.00% 0.00% 0.00% 0 ALARM_TRIGGER_SC

9 80 2496 32 0.00% 0.00% 0.00% 0 Environmental mo

10 61731 75255 820 0.00% 0.03% 0.01% 0 ARP Input

11 0 2 0 0.00% 0.00% 0.00% 0 DDR Timers

12 0 2 0 0.00% 0.00% 0.00% 0 Dialer event

20 0 2 0 0.00% 0.00% 0.00% 0 Hawkeye Backgrou

21 25 145 172 0.00% 0.00% 0.00% 0 Net Input

22 16590 14438 1149 0.00% 0.01% 0.00% 0 Compute load avg

23 34064 1357 25102 0.00% 0.03% 0.00% 0 Per-minute Jobs

24 0 2 0 0.00% 0.00% 0.00% 0 AAA Dictionary R

25 4 2 2000 0.00% 0.00% 0.00% 0 AAA Server

26 4 1 4000 0.00% 0.00% 0.00% 0 AAA ACCT Proc

27 0 1 0 0.00% 0.00% 0.00% 0 ACCT Periodic Pr

28 40206942 811468 49549 84.75% 81.99% 79.45% 0 IP Input

37 0 2 0 0.00% 0.00% 0.00% 0 TCP Protocols

38 0 1 0 0.00% 0.00% 0.00% 0 RARP Input

39 0 1 0 0.00% 0.00% 0.00% 0 HTTP Timer

50 0 2 0 0.00% 0.00% 0.00% 0 LINE AAA

51 0 2 0 0.00% 0.00% 0.00% 0 TPLUS

52 15783 3931 4015 0.06% 0.47% 0.51% 0 Exec

53 0 1 0 0.00% 0.00% 0.00% 0 Router Autoconf

54 0 2 0 0.00% 0.00% 0.00% 0 AAA SEND STOP EV

55 0 1 0 0.00% 0.00% 0.00% 0 Syslog Traps

56 5112661 754742 6774 7.13% 8.11% 8.91% 0 IP NAT Ager

57 62307 1188436 52 0.00% 0.08% 0.08% 0 PPP Events

58 64920 1188430 54 0.06% 0.06% 0.07% 0 PPP manager

59 4369 64088 68 0.00% 0.00% 0.00% 0 Multilink PPP

60 4 2 2000 0.00% 0.00% 0.00% 0 Multilink PPP ou

61 0 2 0 0.00% 0.00% 0.00% 0 Multilink event

62 0 2 0 0.00% 0.00% 0.00% 0 CCP manager

63 0 2 0 0.00% 0.00% 0.00% 0 CCP reset pak

64 108 630 171 0.00% 0.00% 0.00% 0 DHCPD Timer

65 800 19739 40 0.00% 0.00% 0.00% 0 DHCPD Database
首先使用 show ip interface查看各端口的快速交换fast switching是否打开?

各接口状态下应有以下字样:

IP fast switching is enabled

IP fast switching on the same interface is enabled

如果为Disabled状态,则使用命令激活快速交换,命令如下:

在interface FastEthernet0/0或0/1接口配置状态下,输入:

ip route-cache flow

ip route-cache same-interface

打开以后,如果还发生高CPU利用率的现象,那么大多情况是由病毒或蠕虫所引起的。分析如下:

已经打开快速交换了,但是绝大多数包仍被进程交换处理。主要的原因可能是:在网络中可能存在一些终端设备生成了有不同源和目的IP地址的大量数据包,而这些包因不是活跃流目的地址,因此不能匹配到交换缓存条目,进而进行进程交换,最终造成大量CPU处理资源的消耗。而生成这些大量数据包的终端设备究其原因可能是中了病毒或蠕虫。

确认是由病毒或蠕虫引起高CPU利用的证据如下:

cisco2611_ccw#sh interfaces switching 接口交换状态统计

cisco2611_ccw#sh interfaces switching

FastEthernet0/0

Throttle count 0

Drops RP 829911 SP 0

SPD Flushes Fast 0 SSE 0

SPD Aggress Fast 0

SPD Priority Inputs 0 Drops 0

Protocol Path Pkts In Chars In Pkts Out Chars Out

Other Process 0 0 8247 494820

Cache misses 0

Fast 0 0 0 0

Auton/SSE 0 0 0 0

IP Process 2434864 187249121 1235996 118774100

Cache misses 225132

Fast 36222246 2122036996 26320658 3892333621

Auton/SSE 0 0 0 0

ARP Process 181 10860 203 12180

Cache misses 0

Fast 0 0 0 0

Auton/SSE 0 0 0 0

CDP Process 1335 511305 1425 531516

Cache misses 0

Fast 0 0 0 0

Auton/SSE 0 0 0 0

在FastEthernet0/0接口下有829911 RP drops被丢弃,表明有太多的路由请求被丢弃,在处理时已经耗尽CPU资源了。在一个规模不大的网中,怎么会有这么多路由请求,显然是不正常的。同时通过下面的show ip traffic我们可以看到有2116 no route无法路由而被丢弃。更证明了我们前面的推断。是病毒或蠕虫爆发引起的。请注意这个show

ip traffic 的数值没有show interface switching高,主要原因是show ip traffic不是在高CPU利用率的情况下采集的,并且不是与上面的show interfaces switching(高CPU利用率情况下采集)同一时间采集的。

cisco2611_ccw#show ip traffic路由器IP流量统计

cisco2611_ccw#show ip traffic

IP statistics:

Rcvd: 78293161 total, 26548 local destination

0 format errors, 0 checksum errors, 11 bad hop count

3 unknown protocol, 705 not a gateway

0 security failures, 0 bad options, 0 with options

Opts: 0 end, 0 nop, 0 basic security, 0 loose source route

0 timestamp, 0 extended security, 0 record route

0 stream ID, 0 strict source route, 0 alert, 0 cipso, 0 ump

0 other

Frags: 0 reassembled, 15 timeouts, 0 couldn't reassemble

111 fragmented, 0 couldn't fragment

Bcast: 2623 received, 0 sent

Mcast: 0 received, 0 sent

Sent: 20301 generated, 78203505 forwarded

Drop: 173 encapsulation failed, 0 unresolved, 0 no adjacency

2116 no route, 0 unicast RPF, 0 forced drop

因此建议用户对网内终端安全状态进行检查,以杜绝病毒对网络设备的影响。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: