修改进程在指定cpu上运行:taskset -pc 3 21184
进程启动时指定CPU: taskset -c 1 ./redis-server ../redis.conf
1.统计丢包
netstat -s
root@U2:~# netstat -s -u
IcmpMsg:
InType0: 6
InType3: 2840330
InType5: 715
InType8: 11
InType11: 48
OutType0: 11
OutType3: 2832457
OutType8: 40
Udp:
1786529 packets received
312733376 packets to unknown port received
0 packet receive errors
754885510 packets sent
0 receive buffer errors
0 send buffer errors
IgnoredMulti: 16282
UdpLite:
IpExt:
OutMcastPkts: 2
InBcastPkts: 16282
InOctets: 17165483864
OutOctets: 38380998475
OutMcastOctets: 80
InBcastOctets: 1533417
InNoECTPkts: 328407033
root@U2:~#
2.总体cpu 情况
mpstat -P ALL 5 6
root@U2:~# mpstat -P ALL 5 6
Linux 5.4.0-1034-raspi (U2) 06/05/21 _aarch64_ (4 CPU)
08:08:05 CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
08:08:10 all 1.20 0.00 23.85 0.00 0.00 0.00 0.00 0.00 0.00 74.95
08:08:10 0