Skip to content

Seeing slow updates to client-side field indexers #3093

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

Open
jonathan-innis opened this issue Jan 28, 2025 · 3 comments
Open

Seeing slow updates to client-side field indexers #3093

jonathan-innis opened this issue Jan 28, 2025 · 3 comments

Comments

@jonathan-innis
Copy link
Member

While scale testing kubernetes-sigs/karpenter, we created thousands of pending pods at one time. We have a cache field indexer on pending pods that we use to get all of the pending pods on the cluster before we start executing our scheduling loop. We noticed (under high load) that the pending pods were deployed to the cluster but Karpenter was not attempting to schedule these pending pods/did not retrieve these pending pods back when pulling them from the field indexer.

In particular, this seemed like the field indexer may be single threaded or may be bottlenecking under high load. What was stranger is that Karpenter has other threads that it runs in its containers where it publishes metrics on pods. These threads (which weren't using the field indexers) observed the pending pods on the cluster much quicker than the thread that was using the field indexers.

Do we know if there is anything that could cause the field indexers to be slow when placed under high load (are they single threaded) and are there ways that we could improve this performance so that we can rely on these indexers? Or should we look to remove them if we care deeply about the performance of retrieving these pods?

@jonathan-innis jonathan-innis changed the title Seeing slow updates to the client-side field indexers Seeing slow updates to client-side field indexers Jan 28, 2025
@alvaroaleman
Copy link
Member

It is a bit hidden, but the relevant code is not maintained in controller-runtime but imported, specifically its the AddIndexers here: https://pkg.go.dev/k8s.io/client-go/tools/cache#SharedIndexInformer

Refs:

  1. newInformer := cache.NewSharedIndexInformer
  2. return informer.AddIndexers(cache.Indexers{internal.FieldIndexName(field): indexFunc})

I suggest to create an issue in k/k and link it here

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2025
@jonathan-innis
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants