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):
- vyos-router[xxx]: Waiting for NICs to settle down: settled in 1secs…: 24.89 sec
- vyos-router[xxx]: Mounting VyOS Config…done.: 31.07 sec
- vyos-router[xxx]: Starting VyOS router: migrate configure.: 49.12 sec
- vyos-config[xxx]: Configuration success: 49.34 sec
With 1024 static routes added:
- vyos-router[xxx]: Waiting for NICs to settle down: settled in 1secs…: 29.85 sec
- vyos-router[xxx]: Mounting VyOS Config…done.: 36.06 sec
- vyos-router[xxx]: Starting VyOS router: migrate configure.: 306.76 sec
- 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 GATEWAY=192.168.1.254 OCTET_A_START=0 OCTET_A_END=0 OCTET_B_START=0 OCTET_B_END=0 OCTET_C_START=0 OCTET_C_END=3 OCTET_D_START=0 OCTET_D_END=255 # Inject configuration configure for OCTET_A in `seq ${OCTET_A_START} ${OCTET_A_END}` do for OCTET_B in `seq ${OCTET_B_START} ${OCTET_B_END}` do for OCTET_C in `seq ${OCTET_C_START} ${OCTET_C_END}` do for OCTET_D in `seq ${OCTET_D_START} ${OCTET_D_END}` do echo "set vrf name INTERNET protocols static route ${OCTET_A}.${OCTET_B}.${OCTET_C}.${OCTET_D}/32 next-hop ${GATEWAY} distance 1" set vrf name INTERNET protocols static route ${OCTET_A}.${OCTET_B}.${OCTET_C}.${OCTET_D}/32 next-hop ${GATEWAY} distance 1 done done done done commit exit
Forum thread available at: https://forum.vyos.io/t/very-long-time-commit/11596/