Commit 5201212
graph, store: Replace std::sync::RwLock with parking_lot::RwLock for pool metrics
Use parking_lot::RwLock instead of std::sync::RwLock for connection pool
metric recording. parking_lot::RwLock is faster for short-held locks as
it uses efficient spinning before parking, reducing tokio worker thread
blocking during metric recording.
This change helps reduce tokio threadpool contention when the connection
pool is under heavy load, as the metric recording locks are held for
only microseconds.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent dace628 commit 5201212
4 files changed
Lines changed: 9 additions & 7 deletions
File tree
- graph/src
- components/store
- data/graphql
- store/postgres/src/pool
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
720 | 722 | | |
721 | 723 | | |
722 | 724 | | |
723 | | - | |
724 | 725 | | |
725 | 726 | | |
726 | 727 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| |||
0 commit comments