grpc / grpc/grpc-java

Excess contention in ExecutorService

Aperta
#2,118 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
performance
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.