Check CPU Utilization CPU利用率高解決

來源:本站原創 CISCO 超過1,045 views圍觀 0條評論

Check CPU Utilization

If the CPU utilization is high, issue the show processes cpu command first. The output shows you the CPU utilization on the switch as well as the CPU consumption by each process.

Router#show processes cpu CPU utilization for five seconds: 57%/48%; one minute: 56%; five minutes: 48% PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process 1 0 5 0 0.00% 0.00% 0.00% 0 Chunk Manager 2 12 18062 0 0.00% 0.00% 0.00% 0 Load Meter 4 164532 13717 11994 0.00% 0.21% 0.17% 0 Check heaps 5 0 1 0 0.00% 0.00% 0.00% 0 Pool Manager !— Output is suppressed. 172 0 9 0 0.00% 0.00% 0.00% 0 RPC aapi_rp173 243912 2171455 112 9.25% 8.11% 7.39% 0 SNMP ENGINE 174 68 463 146 0.00% 0.00% 0.00% 0 RPC pm-mp !— Output is suppressed.

In this output, the total CPU utilization is 57 percent and the interrupt CPU utilization is 48 percent. Here, these percentages appear in boldface text. The interrupt switch of traffic by the CPU causes the interrupt CPU utilization. The command output lists the processes that cause the difference between the two utilizations. In this case, the cause is the SNMP process.

On the supervisor engine that runs CatOS, the output looks like this:

Switch> (enable) show processes cpuCPU utilization for five seconds: 99.72% one minute: 100.00% five minutes: 100.00%PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process— ———– ———- ——– ——- ——- ——- — —————1 0 0 0 0.28% 0.00% 0.00% -2 Kernel and Idle2 2 261 1000 0.00% 0.00% 0.00% -2 Flash MIB Updat3 0 1 0 0.00% 0.00% 0.00% -2 L2L3IntHdlr 4 0 1 0 0.00% 0.00% 0.00% -2 L2L3PatchRev !— Output is suppressed.61 727295 172025 18000 0.82% 0.00% 0.00% -2 SptTimer 62 18185410 3712736 106000 22.22% 21.84% 21.96% -2 SptBpduRx 63 845683 91691 105000 0.92% 0.00% 0.00% -2 SptBpduTx

In this output, the first process is Kernel and Idle, which shows idle CPU utilization. This process is normally high, unless some other processes consume CPU cycles. In this example, the SptBpduRx process causes high CPU utilization.

If the CPU utilization is high due to one of these processes, you can troubleshoot and determine why this process runs high. But, if the CPU is high due to traffic being punted to the CPU, you need to determine why the traffic is being punted. This determination can help you identify what the traffic is.

Utilities and Tools to Determine the Traffic That Is Punted to the CPU

This section identifies some utilities and tools that can help you look at this traffic.

Cisco IOS System Software

In Cisco IOS Software, the switch processor on the supervisor engine is referred to as the SP, and the MSFC is called the RP.

The show interface command gives basic information on the state of the interface and the traffic rate on the interface. The command also provides error counters.

Router#show interface gigabitethernet 4/1GigabitEthernet4/1 is up, line protocol is up (connected) Hardware is C6k 1000Mb 802.3, address is 000a.42d1.7580 (bia 000a.42d1.7580) Internet address is 100.100.100.2/24 MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 100Mb/s input flow-control is off, output flow-control is off Clock mode is auto ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:00, output hang never Last clearing of “show interface” counters never Input queue: 5/75/1/24075 (size/max/drops/flushes); Total output drops: 2 Queueing strategy: fifo Output queue: 0/40 (size/max) 30 second input rate 7609000 bits/sec, 14859 packets/sec 30 second output rate 0 bits/sec, 0 packets/sec L2 Switched: ucast: 0 pkt, 184954624 bytes – mcast: 1 pkt, 500 bytes L3 in Switched: ucast: 2889916 pkt, 0 bytes – mcast: 0 pkt, 0 bytes mcast L3 out Switched: ucast: 0 pkt, 0 bytes mcast: 0 pkt, 0 bytes 2982871 packets input, 190904816 bytes, 0 no buffer Received 9 broadcasts, 0 runts, 0 giants, 0 throttles 1 input errors, 1 CRC, 0 frame, 28 overrun, 0 ignored 0 input packets with dribble condition detected 1256 packets output, 124317 bytes, 0 underruns 2 output errors, 1 collisions, 2 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out

In this output, you can see that the incoming traffic is Layer 3-switched instead of Layer 2-switched. This indicates that the traffic is being punted to the CPU.

The show processes cpu command tells you whether these packets are regular traffic packets or control packets.

Router#show processes cpu | exclude 0.00 CPU utilization for five seconds: 91%/50%; one minute: 89%; five minutes: 47% PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process 5 881160 79142 11133 0.49% 0.19% 0.16% 0 Check heaps 98 121064 3020704 40 40.53% 38.67% 20.59% 0 IP Input 245 209336 894828 233 0.08% 0.05% 0.02% 0 IFCOM Msg Hdlr

If the packets are process-switched, you see that the IP Input process runs high. Issue this command in order to see these packets:

show buffers input-interface

Router#show buffers input-interface gigabitethernet 4/1 packetBuffer information for Small buffer at 0x437874D4 data_area 0x8060F04, refcount 1, next 0x5006D400, flags 0x280 linktype 7 (IP), enctype 1 (ARPA), encsize 14, rxtype 1 if_input 0x505BC20C (GigabitEthernet4/1), if_output 0x0 (None) inputtime 00:00:00.000 (elapsed never) outputtime 00:00:00.000 (elapsed never), oqnumber 65535 datagramstart 0x8060F7A, datagramsize 60, maximum size 308 mac_start 0x8060F7A, addr_start 0x8060F7A, info_start 0x0 network_start 0x8060F88, transport_start 0x8060F9C, caller_pc 0x403519B4 source: 100.100.100.1, destination: 100.100.100.2, id: 0x0000, ttl: 63, TOS: 0 prot: 17, source port 63, destination port 6308060F70: 000A 42D17580 ..BQu.08060F80: 00000000 11110800 4500002E 00000000 ……..E…….08060F90: 3F11EAF3 64646401 64646402 003F003F ?.jsddd.ddd..?.?08060FA0: 001A261F 00010203 04050607 08090A0B ..&………….08060FB0: 0C0D0E0F 101164 ……d

If the traffic is interrupt switched, you cannot see those packets with the show buffers input-interface command. In order to see the packets that are punted to the RP for interrupt switching, you can perform a Switched Port Analyzer (SPAN) capture of the RP port.

Note: Refer to this document for additional information about interrupt-switched versus process-switched CPU utilization:

SPAN RP-Inband and SP-Inband

A SPAN for the RP or SP port in Cisco IOS Software is available in Cisco IOS Software Release 12.1(19)E and later.

This is the command syntax:

test monitor session 1-66 add {rp-inband | sp-inband} [rx | tx | both]

Use this syntax for the Cisco IOS Software 12.2 SX releases:

test monitor add {1..66} {rp-inband | sp-inband} {rx | tx | both}

Note: For the SXH release, you must use the monitor session command in order to configure a local SPAN session, and then use this command to associate the SPAN session with the CPU:

source {cpu {rp | sp}} | single_interface | interface_list | interface_range | mixed_interface_list | single_vlan | vlan_list | vlan_range | mixed_vlan_list} [rx | tx | both]

Note: For more information on these commands, refer to Configuring Local SPAN (SPAN Configuration Mode) in theCatalyst 6500 Release 12.2SX Software Configuration Guide.

Here is an example on an RP console:

Router#monitor session 1 source interface fast 3/3!— Use any interface that is administratively shut down.Router#monitor session 1 destination interface 3/2

Now, go to the SP console. Here is an example:

Router-sp#test monitor session 1 add rp-inband rx

Note: In Cisco IOS 12.2 SX releases, the command has been changed to test monitor add 1 rp-inband rx.

Router#show monitor Session 1———Type : Local SessionSource Ports :Both : Fa3/3Destination Ports : Fa3/2SP console:Router-sp#test monitor session 1 showIngress Source Ports: 3/3 15/1 Egress Source Ports: 3/3 Ingress Source Vlans: <empty>Egress Source Vlans: <empty>Filter Vlans: <empty>Destination Ports: 3/2

Note: In Cisco IOS 12.2 SX releases, the command has been changed to test monitor show 1.

Here is an example on an SP console:

Router-sp#test monitor session 1 showIngress Source Ports: 3/3 15/1 Egress Source Ports: 3/3 Ingress Source Vlans: <empty>Egress Source Vlans: <empty>Filter Vlans: <empty>Destination Ports: 3/2

CatOS System Software

For switches that run CatOS system software, the supervisor engine runs CatOS and the MSFC runs Cisco IOS Software.

If you issue the show mac command, you can see the number of frames that are punted to the MSFC. Port 15/1 is the supervisor engine connection to the MSFC.

Note: The port is 16/1 for supervisor engines in slot 2.

Console> (enable) show mac 15/1Port Rcv-Unicast Rcv-Multicast Rcv-Broadcast——– ——————– ——————– ——————–15/1 193576 0 1Port Xmit-Unicast Xmit-Multicast Xmit-Broadcast——– ——————– ——————– ——————–15/1 3 0 0Port Rcv-Octet Xmit-Octet——– ——————– ——————–15/1 18583370 0MAC Dely-Exced MTU-Exced In-Discard Out-Discard——– ———- ———- ———- ———–15/1 0 – 0 0

A quick increase in this number indicates that packets are punted to the MSFC, which causes high CPU utilization. You can then look at the packets in these ways:

SPAN MSFC Port 15/1 or 16/1

Set up a SPAN session in which the source is the MSFC port 15/1 (or 16/1) and the destination is an Ethernet port.

Here is an example:

Console> (enable) set span 15/1 5/10Console> (enable) show spanDestination : Port 5/10Admin Source : Port 15/1Oper Source : NoneDirection : transmit/receiveIncoming Packets: disabledLearning : enabledMulticast : enabledFilter : -Status : active

If you collect a sniffer trace on port 5/10, the sniffer trace shows packets that transmit to and from the MSFC. Configure the SPAN session as tx in order to capture packets that are only destined to the MSFC, and not from the MSFC.

SPAN sc0

Set up a SPAN session with the sc0 interface as the source in order to capture frames that go to the supervisor engine CPU.

Console> (enable) set span ? disable Disable port monitoring sc0 Set span on interface sc0 <mod/port> Source module and port numbers <vlan> Source VLAN numbers

Note: For Optical Services Modules (OSMs), you cannot perform a SPAN capture of traffic.

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=295轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
  • 相關文章
  • 為您推薦
  • 各種觀點
?
暫時還木有人評論,坐等沙發!
發表評論

您必須 [ 登錄 ] 才能發表留言!

?
?
萌宠夺宝游戏 江苏快3 宁夏十一选五任选基本走势 极速11选5网站 4场进球彩赛程 北京pk10官网 辽宁35选7走势图原版 贵州11选5最大遗漏 破解广西快乐十分软件 山东时时彩走势图百度百度贴吧 湖南快乐十分 捕鱼棋牌 手机千炮街机捕鱼 游戏挂机赚钱图片 排三复式投注器 2017年免费赚钱商机 穷人走投无路赚钱方法