-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Today, the doublezero config agent (controlplane/agent) downloads the full config to be applied from the controller and applies it in a configuration session. If Arista's ConfigAgent process detects any changes, the doublezero config agent applies them. Checking for changes is a CPU-intensive operation for Arista ConfigAgent, and the largest device in mainnet-beta today has a configuration of over 200KB. This process is repeated every 5 seconds.
Changes are detected in a few cases:
- The configuration has changed on the controller. For new users, we want to learn about this change immediately so we can apply it on the device and bring the user tunnel up
- The configuration was changed manually by the contributor. This is generally done for troubleshooting purposes. Contributors know that they need to disable the agent if they want to avoid this
We can reduce CPU and network usage while staying optimized for case #1 by making the following changes to the doublezero config agent and controller:
- When the config agent starts, call GetConfig and apply it, and add it to a local in-memory config cache, along with its hash
- Every 5 seconds, call GetConfigHash (a new controller call) to get the current hash of the controller's config for the device
- If the hash has not changed, do nothing; if the hash has changed, call GetConfig and apply, and update the local cache
- Every 60 seconds, call GetConfig and apply, and update the cache
This will reduce the frequency at which we undo a contributors changes for scenario #2 above, and it will maintain the same 5-second update interval for scenario 1.