Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-snmp] Provides a config file for the polling interval in sonic_ax_impl #18924

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

PeterTSW-EC
Copy link

Why I did it

By default, SONiC does not restrict the CPU usage of the system containers.
This caused the SNMP container to consume 100% CPU.

A feasible approach is to define a configured file to adjust the SNMP container's CPU usage when required under specific scenarios.
The interval of the polling tasks in the SNMP process also affects the fundamental CPU usage consumed by the SNMP process. So, the configure file also needs to provide the option to change the update intervals in the SNMP process.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Add to support the features:
  1. Restrict the CPU usage of SNMP container through the file: snmp_daemon_control.json
  2. Adjust the polling intervals in SNMP process through the file: snmp_daemon_control.json
    Note: the file snmp_daemon_control.json located at /usr/share/sonic/device/<device_model>/snmp_daemon_control.json

How to verify it

Use the command "docker exec -it snmp ps -x" to examine the interval update.
The following box shows an example of setting the SNMP polling interval to 5 seconds to 10 seconds.

root@as7816-64x:/# docker exec -it snmp ps -x
    PID TTY      STAT   TIME COMMAND
      1 pts/0    Ss+    0:00 /usr/bin/python3 /usr/local/bin/supervisord
     18 pts/0    S      0:00 python3 /usr/bin/supervisor-proc-exit-listener --co
     27 pts/0    Sl     0:00 /usr/sbin/rsyslogd -n -iNONE
     32 pts/0    Sl     0:39 python3 -m sonic_ax_impl
     65 pts/1    Rs+    0:00 ps -x
root@as7816-64x:/# cat /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/snmp_daemon_control.json
{
        "update_frequency": 10
}

root@as7816-64x:/# systemctl restart snmp
root@as7816-64x:/# docker exec -it snmp ps -x
    PID TTY      STAT   TIME COMMAND
      1 pts/0    Ss+    0:00 /usr/bin/python3 /usr/local/bin/supervisord
     18 pts/0    S      0:00 python3 /usr/bin/supervisor-proc-exit-listener --co
     27 pts/0    Sl     0:00 /usr/sbin/rsyslogd -n -iNONE
     32 pts/0    Sl     0:01 python3 -m sonic_ax_impl -f 10
     35 pts/1    Rs+    0:00 ps -x

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@PeterTSW-EC PeterTSW-EC requested a review from qiluo-msft as a code owner May 9, 2024 08:48
@lguohan lguohan added the snmp label May 18, 2024
Description:
In the issue#19028, the new version of requests library caused building sonic image got failed.
The purpose of this PR is to fix the requests library verison to lower than 2.32.0 to let the building pass.
PeterTSW-EC and others added 6 commits June 3, 2024 09:43
By default, SONiC does not restrict the CPU usage of the system containers.
This caused the SNMP container to consume 100% CPU.

A feasible approach is to define a configured file to adjust the SNMP container's CPU usage when required under specific scenarios.
The interval of the polling tasks in the SNMP process also affects the fundamental CPU usage consumed by the SNMP process. So, the configure file also needs to provide the option to change the update intervals in the SNMP process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants