Skip to content

Commit 76d5223

Browse files
authored
[hostcfgd] Delay hostcfgd and aaastatsd for faster boot time (#7965)
#### 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.
1 parent fff1756 commit 76d5223

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

src/sonic-host-services-data/debian/sonic-host-services-data.aaastatsd.service

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ Restart=on-failure
1212
RestartSec=10
1313
TimeoutStopSec=3
1414

15-
[Install]
16-
WantedBy=sonic.target
17-
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Delays aaastatsd daemon until SONiC has started
3+
PartOf=aaastatsd.service
4+
5+
[Timer]
6+
OnActiveSec=1min 30 sec
7+
Unit=aaastatsd.service
8+
9+
[Install]
10+
WantedBy=timers.target sonic.target
11+

src/sonic-host-services-data/debian/sonic-host-services-data.hostcfgd.service

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ After=sonic.target
99
Type=simple
1010
ExecStart=/usr/local/bin/hostcfgd
1111

12-
[Install]
13-
WantedBy=sonic.target
14-
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Delays hostcfgd daemon until SONiC has started
3+
PartOf=hostcfgd.service
4+
5+
[Timer]
6+
OnActiveSec=1min 30 sec
7+
Unit=hostcfgd.service
8+
9+
[Install]
10+
WantedBy=timers.target sonic.target
11+

0 commit comments

Comments
 (0)