Skip to content

Commit 2ea93ab

Browse files
committed
will need to add more benchmarks here later
Signed-off-by: clux <[email protected]>
1 parent 3acb660 commit 2ea93ab

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/blog/posts/2024-06-11-reflector-memory.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ The initial [synthetic benchmarks](https://github.com/kube-rs/kube/pull/1494#iss
152152

153153
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.
154154

155-
__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.
155+
__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.
156156

157-
YMMV, particularly if you are doing a lot of other stuff, but please [reach out](https://discord.gg/tokio) with more results.
157+
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.
158+
159+
So for now; YMMV. Try setting the `page_size` and please [reach out](https://discord.gg/tokio) with more results!
158160

159161
## Thoughts for the future
160162

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

163165
!!! note "Store Tradeoffs"
164166

includes/links.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
[watcher::Config]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html
2525
[watcher::Error]: https://docs.rs/kube/latest/kube/runtime/watcher/enum.Error.html
2626
[Config::page_size]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html#method.page_size
27+
[InitialListStrategy]: https://docs.rs/kube/latest/kube/runtime/watcher/enum.InitialListStrategy.html
2728
[controller::Config]: https://docs.rs/kube/latest/kube/runtime/controller/struct.Config.html
2829
[any_semantic]: https://docs.rs/kube/latest/kube/runtime/watcher/struct.Config.html#method.any_semantic
2930
[Object]: https://docs.rs/kube/latest/kube/core/struct.Object.html

0 commit comments

Comments
 (0)