Skip to content

change worker_polling_time_us to 100000 and default core_number#342

Merged
thweetkomputer merged 3 commits into
mainfrom
polling_time_zc
Jan 7, 2026
Merged

change worker_polling_time_us to 100000 and default core_number#342
thweetkomputer merged 3 commits into
mainfrom
polling_time_zc

Conversation

@thweetkomputer

@thweetkomputer thweetkomputer commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Reference the link of issue using fixes eloqdb/tx_service#issue_id
  • Reference the link of RFC if exists
  • Pass ./mtr --suite=mono_main,mono_multi,mono_basic

Summary by CodeRabbit

  • Chores

    • CPU core allocation now uses a single automatic calculation, capping allocated cores at 90% of available vCPUs (minimum 1).
    • BRPC worker polling interval increased substantially under a specific module (from 1ms to 100ms).
  • New Features

    • Added a configuration option to control max write concurrency per core (default: 1), honored from CLI or INI config.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 7, 2026

Copy link
Copy Markdown

Walkthrough

Replaced conditional per-branch core_num logic with a single automatic calculation and increased BRPC worker polling interval from 1,000 µs to 100,000 µs (in core/src/data_substrate.cpp). Added a new EloqStore configuration flag and wiring for per-core max concurrent writes (in eloq_store_config.cpp).

Changes

Cohort / File(s) Summary
Core worker & BRPC config
core/src/data_substrate.cpp
Unified core_num calculation to core_num = max(1u, (NUM_VCPU * 9) / 10) (removed prior branch-specific values/logs). Under ELOQ_MODULE_ENABLED, changed worker_polling_time_us from 1000 to 100000.
EloqStore configuration
store_handler/eloq_data_store_service/eloq_store_config.cpp
Added new gflag FLAGS_eloq_store_max_concurrent_writes (uint32, default 1) and a new public config field eloqstore_configs_.max_concurrent_writes; populated from CLI flag when non-default or from INI (store.eloq_store_max_concurrent_writes) as fallback and applied to downstream config paths.

Sequence Diagram(s)

(omitted — changes are configuration and local control-flow adjustments that do not introduce a new multi-component sequential flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through flags and cores tonight,
Nine-tenths aligned, a tidy sight,
Polling slowed to steady beats,
Writes queued softly, no one cheats,
🥕 Cheers from this small rabbit sprite.

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'change worker_polling_time_us to 100000' addresses only one component of the changes; the changeset also includes significant modifications to core_num calculation logic and a new eloq_store_max_concurrent_writes configuration flag. Update the title to reflect all major changes, such as 'Optimize worker polling time and core count configuration' or provide a more comprehensive description of the complete changeset.
Description check ⚠️ Warning The PR description only contains the template checklist without any substantive content explaining the changes, rationale, testing, or issue references required by the template. Complete the description by: checking relevant boxes, explaining the changes made, referencing the issue or RFC, documenting test results, and clarifying why these configuration changes were necessary.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch polling_time_zc

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @core/src/data_substrate.cpp:
- Line 797: You changed the BRPC polling interval by calling
GFLAGS_NAMESPACE::SetCommandLineOption("worker_polling_time_us", "100000");
which needs validation and documentation; run comparative performance tests
(measure request latency including tail percentiles and CPU utilization) against
the default polling value, add a short rationale document explaining why 100ms
suits the ELOQ workload (trade-offs of CPU vs latency), add automated tests that
exercise the code path with both default and 100ms settings (asserting
latency/throughput bounds), and record rpcz/bvar profiling output to verify
behavior; update the PR to include the test additions, the performance results
artifact, the rationale text, and mention the exact flag name
worker_polling_time_us and the SetCommandLineOption call so reviewers can locate
the change.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 876056c and 1e0f922.

📒 Files selected for processing (1)
  • core/src/data_substrate.cpp

Comment thread core/src/data_substrate.cpp

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/src/data_substrate.cpp (1)

724-727: Significant increase in automatic core allocation requires documentation.

The core_num formula changed from conditional 60-70% to a fixed 90% of vCPUs. This is a substantial increase that could affect:

  • Memory pressure from additional bthreads
  • CPU contention with other system processes
  • Resource behavior on systems with data store disabled (previously used 70%, now 90%)

Please document the rationale for this change and verify performance under various deployment scenarios.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e593b2 and 07b909b.

📒 Files selected for processing (2)
  • core/src/data_substrate.cpp
  • store_handler/eloq_data_store_service/eloq_store_config.cpp
🧰 Additional context used
🧬 Code graph analysis (1)
store_handler/eloq_data_store_service/eloq_store_config.cpp (2)
core/include/data_substrate.h (1)
  • CheckCommandLineFlagIsDefault (313-324)
store_handler/eloq_data_store_service/main.cpp (3)
  • CheckCommandLineFlagIsDefault (89-101)
  • CheckCommandLineFlagIsDefault (89-89)
  • config_reader (163-163)
🔇 Additional comments (2)
store_handler/eloq_data_store_service/eloq_store_config.cpp (2)

127-129: LGTM!

The new flag follows the established pattern and the default value of 1 is appropriately conservative for write concurrency control.


515-520: LGTM!

The configuration reading follows the established pattern used throughout this file, correctly prioritizing command-line flags over INI config values.

@zhangh43 zhangh43 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@thweetkomputer thweetkomputer merged commit 9836172 into main Jan 7, 2026
4 checks passed
@thweetkomputer thweetkomputer changed the title change worker_polling_time_us to 100000 change worker_polling_time_us to 100000 and default core_number Jan 7, 2026
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.

2 participants