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

[dhcp-relay] Reduce Calls to SONiC Cfggen #5175

Merged

Conversation

tahmed-dev
Copy link
Contributor

Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed [email protected]

- Why I did it
Reduce time required when invoking dhcp-relay

- How I did it
Used template batch mode to batch together three calls into one call to sonic-cfggen

- How to verify it

root@str-s6000-acs-14:/# time ./docker_init_old.sh

real	0m5.548s
user	0m4.370s
sys	0m0.756s
root@str-s6000-acs-14:/# time ./docker_init_new.sh

real	0m1.611s
user	0m1.346s
sys	0m0.221s
root@str-s6000-acs-14:/# diff /etc/supervisor/conf.d/docker-dhcp-relay.supervisord.conf.old /etc/supervisor/conf.d/docker-dhcp-relay.supervisord.conf.new 
root@str-s6000-acs-14:/# diff /usr/bin/wait_for_intf.sh.old /usr/bin/wait_for_intf.sh.new 
root@str-s6000-acs-14:/# diff /tmp/port-name-alias-map.txt.old /tmp/port-name-alias-map.txt.new 
1,32c1,33
< Ethernet8 fortyGigE0/8
< Ethernet0 fortyGigE0/0
< Ethernet4 fortyGigE0/4
< Ethernet108 fortyGigE0/108
< Ethernet100 fortyGigE0/100
< Ethernet104 fortyGigE0/104
< Ethernet96 fortyGigE0/96
< Ethernet124 fortyGigE0/124
< Ethernet120 fortyGigE0/120
< Ethernet92 fortyGigE0/92
< Ethernet28 fortyGigE0/28
< Ethernet52 fortyGigE0/52
< Ethernet56 fortyGigE0/56
< Ethernet76 fortyGigE0/76
< Ethernet72 fortyGigE0/72
< Ethernet32 fortyGigE0/32
< Ethernet16 fortyGigE0/16
< Ethernet36 fortyGigE0/36
< Ethernet12 fortyGigE0/12
< Ethernet88 fortyGigE0/88
< Ethernet24 fortyGigE0/24
< Ethernet116 fortyGigE0/116
< Ethernet80 fortyGigE0/80
< Ethernet112 fortyGigE0/112
< Ethernet84 fortyGigE0/84
< Ethernet48 fortyGigE0/48
< Ethernet44 fortyGigE0/44
< Ethernet40 fortyGigE0/40
< Ethernet64 fortyGigE0/64
< Ethernet60 fortyGigE0/60
< Ethernet20 fortyGigE0/20
< Ethernet68 fortyGigE0/68
---
> Ethernet0 fortyGigE0/0 
> Ethernet4 fortyGigE0/4 
> Ethernet8 fortyGigE0/8 
> Ethernet12 fortyGigE0/12 
> Ethernet16 fortyGigE0/16 
> Ethernet20 fortyGigE0/20 
> Ethernet24 fortyGigE0/24 
> Ethernet28 fortyGigE0/28 
> Ethernet32 fortyGigE0/32 
> Ethernet36 fortyGigE0/36 
> Ethernet40 fortyGigE0/40 
> Ethernet44 fortyGigE0/44 
> Ethernet48 fortyGigE0/48 
> Ethernet52 fortyGigE0/52 
> Ethernet56 fortyGigE0/56 
> Ethernet60 fortyGigE0/60 
> Ethernet64 fortyGigE0/64 
> Ethernet68 fortyGigE0/68 
> Ethernet72 fortyGigE0/72 
> Ethernet76 fortyGigE0/76 
> Ethernet80 fortyGigE0/80 
> Ethernet84 fortyGigE0/84 
> Ethernet88 fortyGigE0/88 
> Ethernet92 fortyGigE0/92 
> Ethernet96 fortyGigE0/96 
> Ethernet100 fortyGigE0/100 
> Ethernet104 fortyGigE0/104 
> Ethernet108 fortyGigE0/108 
> Ethernet112 fortyGigE0/112 
> Ethernet116 fortyGigE0/116 
> Ethernet120 fortyGigE0/120 
> Ethernet124 fortyGigE0/124 
> 
root@str-s6000-acs-14:/# 

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

  • 201811
  • 201911
  • 202006

Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
@tahmed-dev tahmed-dev marked this pull request as ready for review August 14, 2020 01:35
dockers/docker-dhcp-relay/docker_init.sh Outdated Show resolved Hide resolved
dockers/docker-dhcp-relay/port-name-alias-map.txt.j2 Outdated Show resolved Hide resolved
@tahmed-dev tahmed-dev merged commit 3a10e9c into sonic-net:master Aug 17, 2020
abdosi pushed a commit that referenced this pull request Oct 7, 2020
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
lguohan pushed a commit that referenced this pull request Oct 30, 2020
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
abdosi pushed a commit that referenced this pull request Dec 4, 2020
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
abdosi pushed a commit that referenced this pull request Dec 22, 2020
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to one call during startup when starting dhcp-relay
service.

singed-off-by: Tamer Ahmed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants