Skip to content

[swss] Call sonic-cfggen Once#4936

Merged
lguohan merged 2 commits intosonic-net:masterfrom
tahmed-dev:taahme/swss-calls-sonic-cfggen-once
Jul 14, 2020
Merged

[swss] Call sonic-cfggen Once#4936
lguohan merged 2 commits intosonic-net:masterfrom
tahmed-dev:taahme/swss-calls-sonic-cfggen-once

Conversation

@tahmed-dev
Copy link
Contributor

@tahmed-dev tahmed-dev commented Jul 9, 2020

Optimizing number of calls made to sonic-cfggen during service
start up as it adds to total system boot up time.

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

- Why I did it
sonic-cfggen call is slow and it adds to system start up time

- How I did it
places all required variable into single template and called into sonic-cfggen using this template

- How to verify it
-Test 1
there is an average saving of .5 to 1 sec between old script and new script

root@str-s6000-acs-14:/# time ./orchagent_old.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m3.546s
user	0m2.365s
sys	0m0.585s

root@str-s6000-acs-14:/# time ./orchagent_new.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m2.058s
user	0m1.650s
sys	0m0.363s

-Test 2
Built an image with this change and orchagent is running with intended params:

admin@str-s6000-acs-14:~$ ps -ef | grep orchagent
root      2988  1901  1 02:09 pts/0    00:00:02 /usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

- Description for the changelog

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

Copy link
Collaborator

@qiluo-msft qiluo-msft Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export [](start = 0, length = 6)

export [](start = 0, length = 6)

If removing export, is it the same? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be, not sure why the original script had export!

@tahmed-dev tahmed-dev force-pushed the taahme/swss-calls-sonic-cfggen-once branch from 02fafdf to 9897a76 Compare July 9, 2020 21:20
@tahmed-dev tahmed-dev requested a review from qiluo-msft July 10, 2020 02:13
@tahmed-dev tahmed-dev marked this pull request as ready for review July 13, 2020 16:40
Optimizing number of calls made to sonic-cfggen during service
start up as it adds to total system boot up time.

signed-off-by: Tamer Ahmed <[email protected]>
@tahmed-dev tahmed-dev force-pushed the taahme/swss-calls-sonic-cfggen-once branch from 9897a76 to 0b525b7 Compare July 13, 2020 22:55
@lguohan lguohan merged commit 5f3c4fa into sonic-net:master Jul 14, 2020
abdosi pushed a commit that referenced this pull request Jul 26, 2020
Optimizing number of calls made to sonic-cfggen during service
start up as it adds to total system boot up time.

signed-off-by: Tamer Ahmed <[email protected]>

**- Why I did it**
sonic-cfggen call is slow and it adds to system start up time

**- How I did it**
places all required variable into single template and called into sonic-cfggen using this template

**- How to verify it**
***-Test 1***
there is an average saving of .5 to 1 sec between old script and new script
```
root@str-s6000-acs-14:/# time ./orchagent_old.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m3.546s
user	0m2.365s
sys	0m0.585s

root@str-s6000-acs-14:/# time ./orchagent_new.sh
/usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d

real	0m2.058s
user	0m1.650s
sys	0m0.363s
```
***-Test 2***
Built an image with this change and orchagent is running with intended params:
```
admin@str-s6000-acs-14:~$ ps -ef | grep orchagent
root      2988  1901  1 02:09 pts/0    00:00:02 /usr/bin/orchagent -d /var/log/swss -b 8192 -m f4:8e:38:16:bc:8d
```

signed-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.

6 participants