-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource tree slow refresh #8172
Comments
We are same here too. Previously we had 4800+ applications the argocd handles them pretty well, although with some slowness on application listing. After some re-org, we have 3000+ applications now. However, since upgraded v2, the refresh and the sync become very very slow. The refresh action, which supposed to be done in a few seconds can run up to 2 minutes. The sync waiting is even slower. compared to previous using experience, I believe there are large room for performance tuning/improvement. |
It is really difficult to troubleshoot it remotelly. The controller might be CPU throttled, repo server might need to be scaled up or control plane K8S API server might be slow. @klamkma , @yydzhou if possible can we have an interactive session (e.g. zoom call) and debug it together. Later we could document changes we've made to help anyone else who faces this issue. |
Hello, I'm available for a session too. Thank you @alexmt. |
Hi again, I enabled ARGOCD_ENABLE_GRPC_TIME_HISTOGRAM. Thank you |
Any update about this ? We are experiencing the same issue. It may be a duplicate from this issue. There is enough RAM, CPU, disk space, and we tried multiplying the number of replicas of the controller and the server pods by 4 just to see if it helps, but not at all. |
I have the same problem. 2.5k Apps, helm, Argo v2.6.6, 1 very big cluster (HML). I cant see any problem like throttle, OOM's or resource starvation. Did all recommended tunning for high performance. Argocd have a pool with some big nodes just for it to play. Tomorrow i will try to debug the kubernetes cluster to see if the control plane is ok. |
Is there any solution for this, we have somewhere around 6000 applications and argocd version is 2.7.2
|
Hi, For us we had a huge improvement in the UI by enabling |
Any news? We have the same problem with even a smaller cluster of about 1000 apps and 6 clusters. |
@evs-ops, Hi. I’ve tried every possible tunning and version in Argocd and got no improvements…. Since my cluster is running in OpenStack/Rancher inside my company cloud, i’m now improving the cluster itself.. Upgrading kubernetes version, etcd performance etc. I’m doing this because i’m seeing lots of timeouts to kubernetes in application-controller and also because none of the tunning worked. logs:
The symptoms i’m experimenting are: The navigation in argocd web is fast as expected, but if i delete a pod, for exemple, nothing happens. The box with that pod persist in the argocd frontend, but if i watch the namespace using kubectl the pod is beeing killed and a new pod is beeing scheduled. After several minutes (10 ~15m) the new pod spawn in argocd front. This happen with every object owned by argocd. |
Hi, |
Hi, Having more clusters to manage is not a bad thing in my point of view. You can have one replica of application-controller for each cluster. Here are some docs and posts that may help you: https://www.infracloud.io/blogs/sharding-clusters-across-argo-cd-application-controller-replicas/ Did you tried that? Another question: Your clusters are managed (GKE, EKS etc) or is the same as me: Self deployed and managed? |
I bumped my version to v2.10.0-rc4 in order to test jitter implementation on reconciliation. You can check the proposal and description issues/14241. The results till now are incredible, no delay at all in ArgoCD UI/Front. If i delete a pod, the new pod appears instantly, so i recommend you to try if possible. I bumped the version this morning and got an stable environment so far. Will update this thread if something new happens. Some general info about my environment: 2.7k Apps |
Have you found the reason? |
+1 When running 3,000 applications and engaging in activities such as syncing 200 applications, clicking "Restart" for a deployment immediately displays the ReplicaSet, but new pods may take up to two minutes to appear. |
Does anyone have any ideas for solving the problem, or a temporary solution? |
Same problem here. The refresh is very slow (~3-5m) per Application. Even with version 2.10.2 Tried many things, but nothing helps atm |
+1 |
We are encountering a similar issue. In large clusters where Argo CD monitors numerous resources, it is significantly slow in processing watches—taking approximately 7 minutes in our case. Consequently, the Argo CD UI displays outdated information and adversely affects several functionalities that depend on sync waves, such as PruneLast. Eventually, the volume of events from the cluster overwhelmed the system, causing Argo CD to stall completely. To mitigate this, we disabled tracking of Pods and ReplicaSets, which unfortunately diminishes one of the primary advantages of the Argo CD UI. We also disregarded all irrelevant events and attempted to optimize various settings in the application controller. However, scaling the application controller vertically showed no effect, and horizontal scaling is not feasible for a single cluster due to sharding constraints. |
We have removed all argocd config plugins (switched from argocd-vault-plugin to vault-secrets-webhook) and now everything seems to work smoothly |
Hey, this thread can help you as well! https://cloud-native.slack.com/archives/C01TSERG0KZ/p1721141931660909 |
I'm sorry, I can't access the link you provided. Could you please share some details with me? |
We are observing precisely the same issue you described. ArgoCD v2.10.9. |
The fix is there on master and would be a part of v2.13. It optimizes getting resource tree dfs from |
Hi @andrii-korotkov-verkada. Thanks for replying Thanks for your contribution. IterateHierarchyV2 looks promising. I actually patched v2.10.9 with the above commits. It helped, but not to the very end. Even though patches significantly improve performance, Argo CD still can not handle the load from large clusters. In the screenshot, you can see one of the largest clusters. Here, the patched with the above commits v2.10.9 build is running.
As can be seen, once pods and rs are enabled to be tracked, the cluster event count falls close to zero, and reconciliation time increases drastically. Number of pods in cluster: ~76k @andrii-korotkov-verkada Do you have any ideas on what can be improved? |
Are you hitting CPU throttling? |
@crenshaw-dev No, we don't set CPU limits at all and still have plenty of resources on the node. We found that the potential reason is lock contention. Here, I added a few more metrics and found out that when the number of events is significant, sometimes it takes ~5 minutes to acquire a lock, which leads to a delay in reconciliation. NOTE: The following metrics we got in 2.10.9 patched with the following commits: |
I had this attempt argoproj/gitops-engine#602, but the benchmark showed neutral-to-regression in terms of throughput. But maybe average latency can get better, idk. |
I'm curious how much of a performance win you saw from just IterateHierarchy, @mpelekh. Those changes are mostly useful for situations where you have a ton of resources in a single namespace. Am also super curious if Andrii's locking improvements help with this. If so, that's a strong case for merging those changes. |
@crenshaw-dev The comparison is as follows: Large clusterNumber of pods in cluster: ~76k v2.10.9 without improvements, only additional metrics are added (deployed at 18:00 according to Grafana charts)Pods and replica sets are enabled to be watched at 18:25. v2.10.9 with improvements (argoproj/gitops-engine@6b2984e and 267f243) and additional metrics (deployed at 21:30 according to Grafana charts)
Even in the enormous cluster, a very tidy performance improvement can be observed with the v2.10.9 with IterateHierarchyV2 (cluster events count is not completely zero; it's ~3-5k). Smaller clusterHere are the results from a smaller cluster (compared to the previous one). Pods and replica sets are watched. Before 21:45, the v2.10.9 version from upstream was running. This is the case when IterateHierarchyV2 improves performance significantly. |
Gotcha. So IterateHierarchy gets us ~90% of the way there, but on a huge cluster we'll still have significant lock contention. |
@crenshaw-dev I am going to create a patched v2.10.9 image with additional metrics and the following fixes: I will share the results once I test it in a large cluster. |
If the pods and replica sets are excluded from tracking, would they not even show up in Argo UI, or would it just make them potentially stale? |
@andrii-korotkov-verkada If the pods and replica sets are excluded from tracking, they are not visible in the ArgoCD UI; only deployment is visible, and nothing underneath. |
As we agreed, I tested the patched v2.10.9 build with the following fixes: tl;drThe results are almost the same as with only IterateHierarchyV2 improvement. DetailsThe patched image has been deployed to one of the most largest clusters, where the pods and replica sets are disabled from tracking. Please take a look at where one of the additional logs has been added - https://github.com/mpelekh/gitops-engine/blob/e773bed14ca188333ce5f3aa9ca08ab582eff360/pkg/cache/cluster.go#L1429. The results are as follows. Pods and ReplicaSets are disabled from tracking
Enable ReplicaSets to be tracked. The pods are still excluded.APIs count increased to 85
Include ReplicaSets and Pods for watching
We see that the number of processed events decreased significantly when the ReplicaSets and Pods were included for watching. Do you have any thoughts regarding how we can better optimize the lock usage in the cluster so as to handle such a huge number of resources (~210k when RS and Pods are included)? |
Has anyone tried changing the global lock approach by fine-grained locking to avoid lock contentions? |
I don't have thoughts how to optimize lock usage unfortunately. The approach I'm learning about now is a cell architecture with multiple clusters #19607. |
We are experiencing slowness issue on our bigger clusters as well. It would be really helpful for debugging if those temporary lock metrics are added to the metrics exported by Argo |
@crenshaw-dev This PR argoproj/gitops-engine#629 resolves the problem described above. |
Signed-off-by: Mykola Pelekh <[email protected]>
Signed-off-by: Mykola Pelekh <[email protected]>
Signed-off-by: Mykola Pelekh <[email protected]>
Signed-off-by: Mykola Pelekh <[email protected]>
Signed-off-by: Mykola Pelekh <[email protected]>
Hello,
Describe the bug
We have a big kubernetes cluster with almost 3000 argocd applications.
Currently we are running ArgoCD 2.2.2.
Since upgrade to version 2 we noticed that refresh of the resource tree for applications is much slower. For example:
I click on "Restart" for a deployment
ReplicaSet appears immediately
New pod appears sometimes after 40 seconds
I've tried increasing values --status-processors, --operation-processors, --kubectl-parallelism-limit for the controller, but it does not help.
Any idea what could we do? Which component is responsible for this refresh, is it argocd-server?
To Reproduce
I click on "Restart" for a deployment
ReplicaSet appears immediately
New pod appears sometimes after 40 seconds
Expected behavior
Pods should appear faster.
Version
Thank you.
The text was updated successfully, but these errors were encountered: