Commit 94d1759
zhangjianwei
src/msg: fix high CPU consumption of msgr worker thread
problem analysis:
- std::multimap<clock_type::time_point, TimeEvent> time_events
- time precision is nanoseconds
- in EventCenter::process_events function
- end_time > now : Nanosecond comparison
- std::chrono::microseconds>(end_time - now) :
- but converted to microseconds difference
- so timeout_microseconds = 0
- epoll_wait(..., 0) not sleep
- rados bench count : 6000
- Proportion of 0 events processed
- 41898337 / 44796903 = 93.52%
- osd single msgr worker thread cpu high to 100%
solution:
- due to epoll_wait is milliseconds
- add ms_time_events_min_wait_interval
to control how long time_events should wait at least
- so default value aligned to 1000 microseconds
- rados bench count : 6000
- Proportion of 0 events processed
- 424466 / 4489181 = 9.45%
- osd single msgr worker thread cpu high to 30~40%
issue: https://tracker.ceph.com/issues/62512
co-author: yanghonggang <[email protected]>
Signed-off-by: zhangjianwei <[email protected]>1 parent 08d35a8 commit 94d1759
File tree
4 files changed
+27
-6
lines changed- src
- common/options
- msg/async
4 files changed
+27
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1279 | 1296 | | |
1280 | 1297 | | |
1281 | 1298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
| 680 | + | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | | - | |
| 713 | + | |
| 714 | + | |
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
| |||
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
740 | | - | |
| 741 | + | |
741 | 742 | | |
742 | 743 | | |
743 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1552 | 1552 | | |
1553 | 1553 | | |
1554 | 1554 | | |
1555 | | - | |
| 1555 | + | |
1556 | 1556 | | |
1557 | 1557 | | |
1558 | 1558 | | |
| |||
1584 | 1584 | | |
1585 | 1585 | | |
1586 | 1586 | | |
1587 | | - | |
| 1587 | + | |
| 1588 | + | |
1588 | 1589 | | |
1589 | 1590 | | |
1590 | 1591 | | |
| |||
1612 | 1613 | | |
1613 | 1614 | | |
1614 | 1615 | | |
1615 | | - | |
| 1616 | + | |
1616 | 1617 | | |
1617 | 1618 | | |
1618 | 1619 | | |
| |||
0 commit comments