Skip to content

[EXPERIMENT] Test higher singleWriterShards/sqlitePoolSize headroom - #950

Closed
matthyx wants to merge 1 commit into
mainfrom
experiment/sharded-storage-writer-shards16
Closed

matthyx wants to merge 1 commit into
mainfrom
experiment/sharded-storage-writer-shards16

Conversation

@matthyx

@matthyx matthyx commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

This is a diagnostic experiment, not a proposed fix — do not merge.

Follow-up to #949 (default 8-shard validation of kubescape/storage#397): that run showed a big real improvement (15/30 failures vs 18-19/30 baseline, no more sustained 20-minute hangs, individual write latency dropped from minutes to seconds) but not the hoped-for near-zero. Traced the residual failures to occasional context deadline exceeded retries and one new error variant, write metadata: insert metadata: sqlite: step: interrupted, still occurring under concurrent write bursts even with 8-way sharding.

This PR tests whether that residual contention is simply a matter of headroom: bumps singleWriterShards 8→16 and sqlitePoolSize 10→24 via config.json overrides (both are config-driven in kubescape/storage, so no new image build needed — reuses the same validated quay.io/kubescape/storage:test-sharded-writer-397b image from #949).

If this resolves the residual flakiness, it points to needing a higher default shard/pool count for write-heavy environments. If it doesn't help, the residual failures likely have a separate cause (e.g. CI pod churn/restarts observed in #949's investigation) worth investigating independently of the storage fix.

Test plan

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01LLN3CgGftcnAikV13qD6yJ

AI-skills: none | cmds: /oh-my-claudecode:autopilot

Follow-up to the sharded single-writer validation (kubescape/storage#397):
default 8 shards / 10 pool connections reduced failures substantially
(15/30 vs 18-19/30 baseline, and no more sustained 20min hangs) but not
to near-zero. Residual failures show occasional "sqlite: step:
interrupted" errors and context-deadline timeouts under concurrent
write bursts, suggesting 8 shards / pool size 10 may not give enough
headroom for CI's actual burst size. Testing 16 shards / 24 pool
connections via config.json overrides (no new storage image needed --
both are config-driven) to see if more headroom resolves the residual
flakiness or if it points to a separate contributing cause.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLN3CgGftcnAikV13qD6yJ
@matthyx matthyx added the ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin) label Sep 7, 2026
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 6a73f7b8-b5ba-400c-b84c-8c1fe5cdb50a

📥 Commits

Reviewing files that changed from the base of the PR and between 1c450e5 and c7fecbf.

📒 Files selected for processing (2)
  • .github/workflows/component-tests.yaml
  • tests/chart/templates/storage/configmap.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@matthyx

matthyx commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Result: 21 failed / 32 total — worse than #949's 8-shard/pool-10 result (15/30), not better. More shards and more pool connections did NOT reduce the residual flakiness; if anything it got slightly worse.

Conclusion: the residual failures are not a shard/pool-headroom problem. My leading hypothesis now: the storage pod's CPU limit in tests/chart/values.yaml (500m, unchanged in this experiment) is the actual constraint — under a starved CPU quota, more concurrent goroutines add scheduling overhead without proportional throughput gain, which would explain why 16 shards performed no better (or slightly worse) than 8. The pod-churn/restart pattern observed in #949 is also still a candidate, independent of storage entirely.

Not pursuing further shard/pool tuning — closing this experiment.

@matthyx matthyx closed this Sep 7, 2026
@matthyx
matthyx deleted the experiment/sharded-storage-writer-shards16 branch September 7, 2026 10:27
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.200 0.199 -0.3%
Peak CPU (cores) 0.206 0.207 +0.3%
Peak CPU p95 (cores) 0.206 0.206 -0.3%
Avg Memory (MiB) 385.111 311.483 -19.1%
Peak Memory (MiB) 388.699 319.012 -17.9%
Dedup Effectiveness

No data available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant