From 3ebcedbac4f4b84116b6db3cdc5b2c53952fcfd2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:00:57 +0800 Subject: [PATCH] Update snmpd.conf.j2 prolong agentXTimeout to avoid timeout failure in high CPU utilization scenario (#21350) #### Why I did it Fix https://github.com/sonic-net/sonic-buildimage/issues/21314 Update and prolong the timeout of the requests between snmpd and SNMP AgentX. In SONiC SNMP AgentX, the MIB updaters and AgentX client shares the same AsyncIO/Coroutine event loop. During the MIB updaters update the SNMP values, the AgentX client can't respond to the snmpd request. The default value of snmpd request is 1s(timeout) failure_prs.log 5(retries) When the CPU is high, the MIB updaters are slow, 1s timeout is not enough, even if it retries 5 times. Hence update to 5s(timeout) failure_prs.log 4(retries), the time windows = 20s, which makes sure the SNMP request can be handled even with 100% CPU utilization. ##### Work item tracking - Microsoft ADO **30112399**: #### How I did it Update the default value(https://linux.die.net/man/5/snmpd.conf): agentXTimeout 1(default value) -> 5 agentXRetries 5(default value) -> 4 #### How to verify it Test on Cisco chassis, test_snmp_cpu.py which triggers 100% CPU utilization test whether snmp requests work well. #### Which release branch to backport (provide reason below if selected) - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 - [x] 202405 #### Tested branch (Please provide the tested image version) - [x] 202405 - [ ] #### Description for the changelog #### Link to config_db schema for YANG module changes #### A picture of a cute animal (not mandatory but encouraged) --- dockers/docker-snmp/snmpd.conf.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index b6dd826007a1..796b041c9cff 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -194,6 +194,9 @@ trapsink {{ v3SnmpTrapIp }}:{{ v3SnmpTrapPort }}{% if v3SnmpTrapVrf != 'None' %} # # Run as an AgentX master agent master agentx +agentXTimeout 5 +agentXRetries 4 + # internal socket to allow extension to other docker containers # Currently the other container using this is docker-fpm-frr # make sure this line matches bgp:/etc/snmp/frr.conf