Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't pile up successive full refreshes during AWS scaledowns
Force refreshing everything at every `DeleteNodes` calls causes slow down and throttling on large clusters with many ASGs (and lot of activity). that function might be called several times in a row during scale-down (once for each ASG having a node to be removed). Each time the forced refresh will re-discover all ASGs, all LaunchConfigurations, then re-list all instances from disovered ASGs. That immediate refresh isn't required anyway, as the cache's DeleteInstances concrete implementation will decrement the nodegroup size, and we can schedule a grouped refresh for the next loop iteration. As a later step, I'm considering spliting the asgCache.generate() function to support per ASG refreshes (and maybe per ASG caches TTLs + jitter, to spread API calls). But that should address the current issue for now.
- Loading branch information