-
Notifications
You must be signed in to change notification settings - Fork 690
perf(runtime): Use all available parallelism #1858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Performance work showed a drop-off in performance scaling when concurrency exceeds 16. Which is the number of threads we were giving tokio. Now we use all the cores on the machine which is the tokio default (and also what Go does). Also ensure in most cases we only use a single tokio runtime. I still contend the secondary runtime is an unnecessary complication, but this way we preserve optionality (in case we choose to pin the secondary runtime to a single core), but also simplify the performance characteristics.
WalkthroughThe updates introduce optional worker thread configuration for the runtime, allowing it to default to the system's CPU core count when unset. Logging and display formatting for runtime configuration are enhanced. Runtime initialization logic is updated to support these changes, and documentation comments are clarified to accurately reflect runtime behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Main
participant RuntimeConfig
participant Runtime
User->>Main: Start application
Main->>RuntimeConfig: Load settings
RuntimeConfig-->>Main: Return config (num_worker_threads optional)
Main->>Main: Log loaded config
Main->>Runtime: Create runtime(s) with config
Runtime->>RuntimeConfig: Use num_worker_threads or default to CPU cores
Runtime-->>Main: Return initialized runtime(s)
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (2)launch/dynamo-run/src/main.rs (1)lib/runtime/src/config.rs (3)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (13)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Performance work showed a drop-off in performance scaling when concurrency exceeds 16. Which is the number of threads we were giving tokio. Now we use all the cores on the machine which is the tokio default (and also what Go does).
Also ensure in most cases we only use a single tokio runtime. I still contend the secondary runtime is an unnecessary complication, but this way we preserve optionality (in case we choose to pin the secondary runtime to a single core), but also simplify the performance characteristics.
Summary by CodeRabbit
New Features
Bug Fixes
Chores