In some scenarios when the routing table has a large number of routes, the snmpd process consumes 100% CPU, causing bgpd to stop, losing its settings and the host having to be restarted.
top - 19:06:24 up 23:50, 1 user, load average: 0.23, 0.12, 0.04 Tasks: 142 total, 2 running, 99 sleeping, 0 stopped, 0 zombie %Cpu0 : 3.7 us, 0.3 sy, 0.0 ni, 96.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : 1.4 us, 0.7 sy, 0.0 ni, 96.6 id, 0.3 wa, 0.0 hi, 1.0 si, 0.0 st %Cpu2 : 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu3 : 98.7 us, 1.0 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st KiB Mem: 4040552 total, 2620536 used, 1420016 free, 111856 buffers KiB Swap: 0 total, 0 used, 0 free. 244692 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3963 snmp 20 0 173256 119956 4504 R 100.0 3.0 2:05.66 snmpd 4008 root 20 0 104248 20036 14980 S 4.0 0.5 50:36.23 uacctd 4003 root 20 0 119708 33596 23456 S 1.3 0.8 26:15.33 uacctd 17 root 20 0 0 0 0 S 0.3 0.0 1:14.61 ksoftirqd/1
After testing snmpd configuration by removing the ipCidrRouteTable and inetCidrRouteTable modules, CPU usage was normalized.
SNMPDOPTS = '- LSed -u snmp -g snmp -I -ipCidrRouteTable, inetCidrRouteTable -p /run/snmpd.pid'