Commit times during configuration mode but also during boot increases ALOT when more than a few hundred static routes are being used.
Using 1.4-rolling-202307200317 the commit times with 1024 static routes loaded took about 1 minute when changing "set firewall all-ping disable" (normally takes 3-4 seconds with only a handful of static routes).
Boot time increased from less than 1 minute to more than 5 minutes.
With a few static routes (timestamps as seen in console during boot):
1. vyos-router[xxx]: Waiting for NICs to settle down: settled in 1secs…: 24.89 sec
2. vyos-router[xxx]: Mounting VyOS Config…done.: 31.07 sec
3. vyos-router[xxx]: Starting VyOS router: migrate configure.: 49.12 sec
4. vyos-config[xxx]: Configuration success: 49.34 sec
With 1024 static routes added:
1. vyos-router[xxx]: Waiting for NICs to settle down: settled in 1secs…: 29.85 sec
2. vyos-router[xxx]: Mounting VyOS Config…done.: 36.06 sec
3. vyos-router[xxx]: Starting VyOS router: migrate configure.: 306.76 sec
4. vyos-config[xxx]: Configuration success: 306.77 sec
In this particular case the VyOS is being runned in Virtualbox on a Ubuntu host with 2 VCPU configured and 8GB of RAM.
Host CPU is: Intel(R) Core(TM) i5-4250U CPU.
The ones to blame seems to be a combo of:
root@vyos:/home/vyos# ps auxwww | grep -i union
root 3046 13.7 0.0 299624 2772 ? Ssl 04:04 0:31 unionfs-fuse -o cow -o allow_other /opt/vyatta/config/tmp/changes_only_3030=RW:/opt/vyatta/config/active=RO /opt/vyatta/config/tmp/new_config_3030
and /usr/lib/frr/staticd who both take alot of time both during injection and commit.
Script used to inject static routes:
```
#!/bin/vbash
# Include VyOS functions
source /opt/vyatta/etc/functions/script-template
# Script debugging:
#set -x
# Set variables
START_OCTET_A=0
END_OCTET_A=0
START_OCTET_B=0
END_OCTET_B=0
START_OCTET_C=0
END_OCTET_C=3
START_OCTET_D=0
END_OCTET_D=255
# Inject configuration
configure
for OCTET_A in `seq ${START_OCTET_A} ${END_OCTET_A}`
do
for OCTET_B in `seq ${START_OCTET_B} ${END_OCTET_B}`
do
for OCTET_C in `seq ${START_OCTET_C} ${END_OCTET_C}`
do
for OCTET_D in `seq ${START_OCTET_D} ${END_OCTET_D}`
do
echo "set vrf name INTERNET protocols static route ${OCTET_A}.${OCTET_B}.${OCTET_C}.${OCTET_D}/32 next-hop 192.0.2.1 distance 1"
set vrf name INTERNET protocols static route ${OCTET_A}.${OCTET_B}.${OCTET_C}.${OCTET_D}/32 next-hop 192.0.2.1 distance 1
done
done
done
done
commit
exit
```
Forum thread available at: https://forum.vyos.io/t/very-long-time-commit/11596/