perf(engine): make I/O executor model configurable, default to virtua…#220
Open
neuralasmi wants to merge 1 commit into
Open
perf(engine): make I/O executor model configurable, default to virtua…#220neuralasmi wants to merge 1 commit into
neuralasmi wants to merge 1 commit into
Conversation
…l threads MaestroParamExtensionRepo previously hard-coded a 3-thread fixed pool (\Executors.newFixedThreadPool(THREAD_NUM)\) to fan out JDBC and signal lookups. That cap was a hard ceiling on concurrent in-flight I/O calls across the whole engine. This change replaces the hard-coded pool with a configurable executor built by the new \EngineExecutors\ factory. The factory selects between Java 21 virtual threads (\Executors.newThreadPerTaskExecutor\) and a bounded platform-thread pool based on the new \maestro.threading.*\ configuration. Virtual threads are the default; \PLATFORM\ is preserved as a one-line rollback target if a regression is observed in production. The repository now owns the executor lifecycle (constructed in \initialize()\, shut down with a 5s grace period in \shutdown()\) and threads the executor through to \MaestroParamExtension\ via constructor injection. A backward-compatible 3-arg constructor preserves the existing public surface for tests and downstream consumers, defaulting to virtual threads. No new \synchronized\ blocks were introduced and none existed in the I/O path under change, so the documented virtual-thread pinning failure mode does not apply to this refactor. A new test (\EngineExecutorsTest\) empirically demonstrates the win: 16 concurrent 100 ms I/O-style tasks complete in ~100 ms with virtual threads (vs ~800 ms on a 2-thread platform pool) and verifies that the created threads are actually virtual. Co-authored-by: Netflix Maestro Maintainers <maestro-dev@netflix.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MaestroParamExtensionRepoused a hard-coded fixed thread pool of 3 threads (Executors.newFixedThreadPool(THREAD_NUM)) to fan out JDBC and signal lookups. This limited concurrent in-flight I/O calls across the entire engine.The fixed 3‑thread cap created an unnecessary throughput bottleneck for I/O‑bound operations, increasing latency and underutilising resources when the engine could otherwise handle more parallelism.
EngineExecutorsfactory.Executors.newThreadPerTaskExecutor) and a bounded platform‑thread pool based onmaestro.threading.*configuration. Virtual threads are the default;PLATFORMremains available as a one‑line rollback.initialize(), shut down with a 5‑second grace period inshutdown(), and passed toMaestroParamExtensionvia constructor injection.synchronizedblocks were introduced, and none existed in the changed I/O path, avoiding the known virtual‑thread pinning failure mode.Summary of changes
EngineExecutorsfactory with configuration keysmaestro.threading.model(VIRTUALorPLATFORM) and optional pool sizing.MaestroParamExtensionRepoto use the configurable executor instead of the fixed 3‑thread pool.MaestroParamExtension.EngineExecutorsTestto verify virtual threads complete 16 concurrent 100 ms I/O tasks in ≈100 ms (vs ≈800 ms on a 2‑thread platform pool) and confirm created threads are virtual.