Skip to content

Vertical scaling issues with Java Client #1046

Open

Description

@Ramkumar92

Cadence Java client exhibits severe vertical scaling limitations that prevent it from utilizing additional CPU cores and threads beyond a certain point. Despite increasing the number of pollers, executor threads, and concurrency settings, throughput plateaus due to bottlenecks.

Potential problems:

  1. SynchronousQueue Bottleneck in PollTaskExecutor
    Location: /src/main/java/com/uber/cadence/internal/worker/PollTaskExecutor.java:54-59

The PollTaskExecutor uses a SynchronousQueue with zero capacity for task handoff:

taskExecutor = options.getExecutorWrapper().wrap(
    new ThreadPoolExecutor(
        0,
        options.getTaskExecutorThreadPoolSize(),
        1,
        TimeUnit.SECONDS,
        new SynchronousQueue<>()));
  1. Per-Workflow Lock Serialization
    Location: /src/main/java/com/uber/cadence/internal/worker/WorkflowWorker.java:197-201

Issue:

Lock runLock = null;
if (!Strings.isNullOrEmpty(stickyTaskListName)) {
    runLock = runLocks.getLockForLocking(task.getWorkflowExecution().getRunId());
    runLock.lock();
}
  1. Synchronized Throttler Contention
    Location: /src/main/java/com/uber/cadence/internal/worker/Throttler.java:93
public synchronized void throttle() throws InterruptedException {
    long now = System.currentTimeMillis();
    // ... entire method is synchronized
}

Could you please investigate this ?

Activity

  1. added
    triage/needs-infoBlocked pending more info from the reporter (repro, version, logs) before triage.
    kind/bugExisting behavior is broken or not working as documented/intended.
    on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugExisting behavior is broken or not working as documented/intended.triage/needs-infoBlocked pending more info from the reporter (repro, version, logs) before triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions