Skip to content

Implement Admin cli pool for data collection and pre-render collected data for serving - #41

Draft
Frawless wants to merge 13 commits into
strimzi:mainfrom
Frawless:improve-performance
Draft

Frawless wants to merge 13 commits into
strimzi:mainfrom
Frawless:improve-performance

Conversation

@Frawless

@Frawless Frawless commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Type of Change

  • Bugfix
  • Enhancement / new feature

Description

This PR improves performance based on #37 and #38 findings.

It adds pool of Admin clients that is used for collecting data from Kafka nodes. The original implementation had only one instance of Admin which resulted into very slow collection, especially for cluster with a lot of partitions per topic (wide topics). User can specify STRIMZI_ADMIN_CLIENT_POOL_SIZE to define pool size (default is 4).

The other fix is for scrape part where we now pre-render data collected from Kafka and serve them when HTTP request comes. This means that when there are multiple http requests ber collection cycle, Sova will serve pre-rendered (cached) data from latest successful collection cycle instead of doing the render everytime when new request arrives. It should improve perf for clusters where cycles are longer than Prometheus scrape interval.

The bellow table shows average collection times (10 colletion cycles per scenario)

Scenario Pool 1 Pool 4 Pool 8
1k topics × 10, 1k groups × 5 0.35 s 0.20 s 0.26 s
10k × 10, 10k groups × 5 5.74 s 1.67 s 1.51 s
50k × 2, 10k groups × 5 3.33 s 2.17 s 1.86 s
1k × 10, 100k groups × 2 5.75 s 3.70 s 3.24 s
120 × 700, 600 groups × 2 (84k partitions, like their cluster) 30.6 s 1.30 s 1.31 s
240 × 700, 1,800 groups × 2 (2.52M committed, like their cluster) no cycle finished 10.9 s (12.4 s) 4.1 s (5.4 s)
  • - The PR is just PoC with couple of tests and should be polished before merging.
  • - if we will agree on this PR, add also workflow with perf pipeline
  • - improve also test coverage based on codecov

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Update documentation
  • Update CHANGELOG.md (if present)
  • Reference relevant issue(s) and close them after merging
  • Write tests
  • Make sure all tests pass
  • Try your changes inside a Kubernetes cluster, not just from unit tests
  • AI assistance was used to create this PR (see the Strimzi AI policy)

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
@Frawless Frawless added this to the 0.2.0 milestone Dec 2, 2026
@snyk-io

snyk-io Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
@codecov-commenter

codecov-commenter commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.23529% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.44%. Comparing base (85127f5) to head (f0a679f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/main/java/io/strimzi/sova/Main.java 62.50% 2 Missing and 1 partial ⚠️
...o/strimzi/sova/http/PrerenderedMetricsHandler.java 95.23% 1 Missing and 1 partial ⚠️
.../java/io/strimzi/sova/metrics/MetricsRegistry.java 95.83% 0 Missing and 2 partials ⚠️
...java/io/strimzi/sova/metrics/RenderedResponse.java 98.83% 0 Missing and 1 partial ⚠️
...trimzi/sova/metrics/collectors/TopicCollector.java 97.87% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #41      +/-   ##
============================================
+ Coverage     91.96%   97.44%   +5.48%     
- Complexity      159      301     +142     
============================================
  Files            16       19       +3     
  Lines           610     1058     +448     
  Branches         53      107      +54     
============================================
+ Hits            561     1031     +470     
+ Misses           41       13      -28     
- Partials          8       14       +6     
Flag Coverage Δ
integrationtests 97.44% <98.23%> (+5.48%) ⬆️
unittests 97.44% <98.23%> (+5.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
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

Successfully merging this pull request may close these issues.

Scrape size on clusters with a very large number of consumer group partitions

2 participants