linux???????????????--CPU??Memory??IO??Network
???????????? ???????[ 2013/9/17 15:09:44 ] ????????
????????Memory
????1???????????
????swap in ??si?? == 0??swap out ??so?? == 0
??????ó?????????/????????? <= 70%
????2????????
vmstat
$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 3 252696 2432 268 7148 3604 2368 3608 2372 288 288 0 0 21 78 1
0 2 253484 2216 228 7104 5368 2976 5372 3036 930 519 0 0 0 100 0
0 1 259252 2616 128 6148 19784 18712 19784 18712 3821 1853 0 1 3 95 1
1 2 260008 2188 144 6824 11824 2584 12664 2584 1347 1174 14 0 0 86 0
2 1 262140 2964 128 5852 24912 17304 24952 17304 4737 2341 86 10 0 0 4
?????????????
????swpd???????? SWAP ????С??KB ???λ??
????free???????????????С??KB ???λ??
????buff??????????????????д??????buffer??С??KB ???λ??
????cache?????????????????????????? cache ??С??KB ???λ??
????si??????? SWAP ????? RAM??swap in?????С??KB ???λ??
????so??????? RAM д?? SWAP??swap out?????С??KB ???λ??
?????????????????????? free ????????????仯??swapd??????????С???????????????? 256MB(????????С) * 10?? = 2.56MB ????????????10???????????????swap??
free
$ free -m
total used free shared buffers cached
Mem: 8111 7185 926 0 243 6299
-/+ buffers/cache: 643 7468
Swap: 8189 0 8189
????????????IO
????1???????????
????iowait % < 20%
????????????????????????????????????????????????????????????????????????
????Linux ?????????????????????ж??????????????????????????????????????ж????????????????????????ж????????????????????????????????????????????????? Linux ????????Щ????????
????2????????
????????????????????????
$ cat /proc/meminfo
MemTotal: 8182776 kB
MemFree: 3053808 kB
Buffers: 342704 kB
Cached: 3972748 kB
?????????????????? 8GB ??????棨MemTotal????3GB ?????????棨MemFree????343MB????????????????棨Buffers????4GB?????????????????????Cached????
sar
$ sar -d 2 3
Linux 2.6.9-42.ELsmp (webserver) 11/30/2008 _i686_ (8 CPU)
11:09:33 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
11:09:35 PM dev8-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
11:09:35 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
11:09:37 PM dev8-0 1.00 0.00 12.00 12.00 0.00 0.00 0.00 0.00
11:09:37 PM DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
11:09:39 PM dev8-0 1.99 0.00 47.76 24.00 0.00 0.50 0.25 0.05
Average: DEV tps rd_sec/s wr_sec/s avgrq-sz avgqu-sz await svctm %util
Average: dev8-0 1.00 0.00 19.97 20.00 0.00 0.33 0.17 0.02
?????????????
????await??????????豸I/O???????????????????λ????
????svctm??????????豸I/O????????????????????λ????
????%util?????????а??????????????I/O??????
???????svctm?????await????????????????I/O???????????????????await????????svctm?????????I/O???е??????????????е???ó?????????
???????%util?????????????????I/O???????I/O???????????????????????????????????
???????Network IO
????????UDP
????1???????????
??????????????????????????е????????????
????2????????
????netstat
????????UDP?????????м?????UDP???????????
$ watch netstat -lunp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:64000 0.0.0.0:* -
udp 0 0 0.0.0.0:38400 0.0.0.0:* -
udp 0 0 0.0.0.0:38272 0.0.0.0:* -
udp 0 0 0.0.0.0:36992 0.0.0.0:* -
udp 0 0 0.0.0.0:17921 0.0.0.0:* -
udp 0 0 0.0.0.0:11777 0.0.0.0:* -
udp 0 0 0.0.0.0:14721 0.0.0.0:* -
udp 0 0 0.0.0.0:36225 0.0.0.0:* -
????RecvQ??SendQ?0????????????????????????????
????????UDP???????????????????????????????ò???д???????????????
$ watch netstat -su
Udp:
278073881 packets received
4083356897 packets to unknown port received.
2474435364 packet receive errors
1079038030 packets sent
????packet receive errors ???????????????????????????
?????????ж?“packet receive errors”????????Щ??????????????7?????and?????????checksum??????????????????????????仯???ж?UDP?????????????2??????????????????????????????ж?UDP?????????
"packet receive errors" usually means:
1) data is truncated?? error in checksum while copying
2) udp queue is full?? so it needs to be dropped
3) unable to receive udp package from encapsulated socket
4) sock_queue_rcv_skb() failed with -ENOMEM
5) it is a short packet
6) no space for header in udp packet when validating packet
7) xfrm6_policy_check() fails
many times it means the checksum is not right.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11