After every commit, the post-commit hook 01vyos-commit-revision spends time that grows with the size of the config, independent of what the commit changed. On a VyOS 1.5.1 VM with a 10,000-rule prefix-list, removing the extra reads shortened each of three commits by 77–78 s (about 256 s → 178 s).
Root cause.
- config_mgmt.run() builds ConfigMgmt(), which builds a full Config(): it reads and parses the active config and the working config. The working config is read through the commit session's unionfs-fuse mount, which takes seconds on a large config.
- To write the archive copy (/config/archive/config.boot and config.json), the hook then starts vyos-save-config.py, which builds another full Config() of the same content.
- The hooks run after the commit has written the active config, so after a successful commit one read of the active config is enough for both.
Fix direction. Read the committed config once from the active store and write the archive copy from that tree.