Skip to content

Commit

Permalink
[hostcfgd] Delay hostcfgd and aaastatsd for faster boot time (#7965)
Browse files Browse the repository at this point in the history
#### Why I did it
hostcfgd is starting at the same time as 'create_switch' method is called on orchagent process.
This introduce a degradation on the function execution time which eventually cause the fast-boot flow and a boot scenarion in general to run slower (~6 seconds).
This change will delay the start time of this daemon.
The aaastatsd will delay as well since it has a dependency on hostcfgd, so it is required to delay both.
90 seconds determined as the maximum allowed downtime for control plane to come back up on fast-boot flow.

#### How I did it
Add two timers for hostcfgd and aaastatsd  services in order to delay the startup of these services.

#### How to verify it
Install an image with this change and observe the daemons start 90 seconds after the system boot.
  • Loading branch information
shlomibitton authored Aug 10, 2021
1 parent fff1756 commit 76d5223
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ Restart=on-failure
RestartSec=10
TimeoutStopSec=3

[Install]
WantedBy=sonic.target

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Delays aaastatsd daemon until SONiC has started
PartOf=aaastatsd.service

[Timer]
OnActiveSec=1min 30 sec
Unit=aaastatsd.service

[Install]
WantedBy=timers.target sonic.target

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ After=sonic.target
Type=simple
ExecStart=/usr/local/bin/hostcfgd

[Install]
WantedBy=sonic.target

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Delays hostcfgd daemon until SONiC has started
PartOf=hostcfgd.service

[Timer]
OnActiveSec=1min 30 sec
Unit=hostcfgd.service

[Install]
WantedBy=timers.target sonic.target

0 comments on commit 76d5223

Please sign in to comment.