sonic-buildimage/files/build_templates/pmon.timer
shlomibitton c71c91e2b0
[202012] [Fastboot] Delay PMON service for better fastboot performance (#10745)
#### Why I did it

Profiling the system state on init after fast-reboot during create_switch function execution, it is possible to see few python scripts running at the same time.
This parallel execution consume CPU time and the duration of create_switch is longer than it should be.
Following this finding, and the motivation to ensure these services will not interfere in the future, PMON is delayed in 90 seconds until the system finish the init flow after fastboot.

#### How I did it

Add a timer for PMON service.
Exclude for MLNX platform the start trigger of PMON when SYNCD starts in case of fastboot.
Copy the timer file to the host bin image.

#### How to verify it

Run fast-reboot on MLNX platform and observe faster create_switch execution time.
2022-05-15 23:31:32 -07:00

13 lines
270 B
SYSTEMD

[Unit]
# This delay is for fast/warm reboot performance
Description=Delays pmon docker until SONiC has started
PartOf=pmon.service
[Timer]
OnUnitActiveSec=0 sec
OnBootSec=1min 30 sec
Unit=pmon.service
[Install]
WantedBy=timers.target sonic.target sonic-delayed.target