Skip to content

Commit

Permalink
will need to add more benchmarks here later
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Jun 12, 2024
1 parent 3acb660 commit 2ea93ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/blog/posts/2024-06-11-reflector-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ The initial [synthetic benchmarks](https://github.com/kube-rs/kube/pull/1494#iss

Whether the ad-hoc synthetic benchmarks are in any way realistic going forwards remains to be seen. How much you can get likely depends on a range of factors from allocator choice to usage patterns.

__So far__, we have seen controllers with a basically unchanged profile, some with small improvements in the 10-20% range, and one [50% drop in a real-world controller](https://github.com/kube-rs/kube/pull/1494#issuecomment-2126694967) (ironically, the one I used to test the change). The default [Config::page_size] of 500 does seem to undermine the optimization somewhat. Try setting the page size to 50 to get a bigger effect.
__So far__, we have seen controllers with a basically unchanged profile, some with small improvements in the 10-20% range, and one [50% drop in a real-world controller](https://github.com/kube-rs/kube/pull/1494#issuecomment-2126694967) from testing.

YMMV, particularly if you are doing a lot of other stuff, but please [reach out](https://discord.gg/tokio) with more results.
When using the standard `ListWatch` [InitialListStrategy], the default [Config::page_size] of `500` will undermine this optimization, because individual pages are still kept in the watcher while they are being sent out one-by-one. Setting the page size to `50` has been necessary for me to get anything close to the benchmarks.

So for now; YMMV. Try setting the `page_size` and please [reach out](https://discord.gg/tokio) with more results!

## Thoughts for the future

The 2x overhead here does hint at a potential future optimization; allowing users to opt-out of the "store completeness" guarantee.
The peak 2x overhead here does hint at a potential future optimization; allowing users to opt-out of the _store completeness_ guarantee.

!!! note "Store Tradeoffs"

Expand Down
1 change: 1 addition & 0 deletions includes/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
[watcher::Config]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html
[watcher::Error]: https://docs.rs/kube/latest/kube/runtime/watcher/enum.Error.html
[Config::page_size]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html#method.page_size
[InitialListStrategy]: https://docs.rs/kube/latest/kube/runtime/watcher/enum.InitialListStrategy.html
[controller::Config]: https://docs.rs/kube/latest/kube/runtime/controller/struct.Config.html
[any_semantic]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html#method.any_semantic
[Object]: https://docs.rs/kube/latest/kube/core/struct.Object.html
Expand Down

0 comments on commit 2ea93ab

Please sign in to comment.