Skip to content

Excess contention in ExecutorService #2118

Open
@carl-mastrangelo

Description

@carl-mastrangelo

When profiling a client with 200K active RPCs, there is a point of contention on the Executor. Each RPC gets its own SerializingExecutor, which executes work on an underlying executor. Currently, that executor is ThreadPoolExecutor in almost all cases, which itself has a BlockingQueue. That queue is heavily contended showing up at minutes of wasted time:

141.17mins 79.41% 79.41% 141.22mins 79.44%  java.util.concurrent.LinkedBlockingQueue.offer LinkedBlockingQueue.java
 36.51mins 20.54% 99.95%  36.52mins 20.54%  java.util.concurrent.LinkedBlockingQueue.take LinkedBlockingQueue.java

An idea to fix this is to have some sort of striping executor in order to prevent this contention from happening.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions