-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
Description
Title
Allow externally managed ExecutorService for multi-node pipeline operations
Description
Problem:
Multi-node pipelines create a new ExecutorService on every sync() call (line 93), causing significant overhead in high-throughput applications:
@Override
public final void sync() {
// ...
if (multiNode) {
executorService = Executors.newFixedThreadPool(MULTI_NODE_PIPELINE_SYNC_WORKERS);
executor = executorService;
}
// ...
}Thread creation is expensive:
- Allocates large memory blocks for thread stacks
- Requires system calls to register native threads
- Adds latency to each pipeline operation
In high-throughput scenarios (e.g., 100k ops/sec), this overhead can consume 40% of CPU.
Proposed Solution:
Allow users to provide an externally managed ExecutorService that can be reused across pipeline operations
Benefits:
- Eliminates thread creation overhead
- Allows tuning executor to specific workload patterns
- Maintains backward compatibility with current behavior as default
Related:
- Approach 1 Provide executor on pipeline creation - Initial suggested approach with providing
- Approach 2 Pipeline executor provided on client level & shared by pipelines
- Current workaround: Adjust
MULTI_NODE_PIPELINE_SYNC_WORKERS(doesn't solve the core issue)