Skip to content

Commit 99eaa84

Browse files
authored
Delay pmon non-critical daemon (#18907)
- Why I did it After this pull request #19190 , the pmon has been added to the start list in fast/warm reboot scenarios. However, certain non-critical daemons of pmon could be delayed, resulting in a saving of approximately 1 second in the reboot process. For performance considerations, especially as the current time usage of fast reboot is closer to 30 seconds limitation, this change could ease the pressure. - How I did it add a script as fast/warm reboot monitor and relative supervisord rlues. once the script exited means the reboot process has ended, other delayed daemon would then initialize. - How to verify it check the fast/warm reboot time usage Signed-off-by: Yuanzhe, Liu <[email protected]>
1 parent 71fd069 commit 99eaa84

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"skip_ledd": true,
33
"skip_fancontrol": true,
44
"delay_xcvrd": true,
5-
"skip_xcvrd_cmis_mgr": true
5+
"skip_xcvrd_cmis_mgr": true,
6+
"delay_non_critical_daemon": true
67
}
78

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python3
2+
3+
# This file serves as a monitor for advanced reboot.
4+
# Once it exits, the delayed daemon will initiate.
5+
6+
from swsscommon.swsscommon import RestartWaiter
7+
RestartWaiter.waitAdvancedBootDone()

dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2

+16-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ stdout_logfile=syslog
2828
stderr_logfile=syslog
2929
dependent_startup=true
3030

31+
32+
{% if delay_non_critical_daemon %}
33+
[program:delay]
34+
command=python3 /usr/bin/delay.py
35+
autostart=false
36+
autorestart=false
37+
startsecs=0
38+
dependent_startup=true
39+
{% endif %}
40+
3141
{% if not skip_chassisd and (IS_MODULAR_CHASSIS == 1 or is_smartswitch) %}
3242
[program:chassisd]
3343
command=/usr/local/bin/chassisd
@@ -64,7 +74,7 @@ stdout_logfile=syslog
6474
stderr_logfile=syslog
6575
startsecs=0
6676
dependent_startup=true
67-
dependent_startup_wait_for=rsyslogd:running
77+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
6878
{% endif %}
6979

7080
{% if not skip_fancontrol and HAVE_FANCONTROL_CONF == 1 %}
@@ -151,7 +161,7 @@ stdout_logfile=syslog
151161
stderr_logfile=syslog
152162
startsecs=10
153163
dependent_startup=true
154-
dependent_startup_wait_for=rsyslogd:running
164+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
155165
{% endif %}
156166

157167
{% if not skip_syseepromd %}
@@ -164,7 +174,7 @@ stdout_logfile=syslog
164174
stderr_logfile=syslog
165175
startsecs=10
166176
dependent_startup=true
167-
dependent_startup_wait_for=rsyslogd:running
177+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
168178
{% endif %}
169179

170180
{% if not skip_thermalctld %}
@@ -178,7 +188,7 @@ stderr_logfile=syslog
178188
startsecs=10
179189
startretries=50
180190
dependent_startup=true
181-
dependent_startup_wait_for=rsyslogd:running
191+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
182192
{% endif %}
183193

184194
{% if not skip_pcied %}
@@ -191,7 +201,7 @@ stdout_logfile=syslog
191201
stderr_logfile=syslog
192202
startsecs=10
193203
dependent_startup=true
194-
dependent_startup_wait_for=rsyslogd:running
204+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
195205
{% endif %}
196206

197207
{% if include_sensormond %}
@@ -204,7 +214,7 @@ stdout_logfile=syslog
204214
stderr_logfile=syslog
205215
startsecs=10
206216
dependent_startup=true
207-
dependent_startup_wait_for=rsyslogd:running
217+
dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}delay:exited{% endif %}
208218
{% endif %}
209219

210220
{% if not skip_stormond %}

0 commit comments

Comments
 (0)