Excess contention in ExecutorService
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Start by examining the SerializingExecutor and ThreadPoolExecutor path described in the issue, including the BlockingQueue contention shown by the profile. The scope is to define and evaluate a striping-executor approach for the 200K-RPC workload; the issue does not name files, tests, or a more specific completion criterion.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- backend-api-design, performance
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100