elementsd shutdown seems unnecessarily slow for long-running nodes
まだ誰も着手していません。
評価
調査の方向性
まず、ブロックインデックスを手動でアンロードし、そのエントリを解放するシャットダウン経路を特定し、次にそれをプロセス終了時の動作と比較します。可能であれば、長時間稼働した node の後にシャットダウンを再現し、複数のブロックインデックスを作成および破棄するテストケースを調査します。テストで必要とされる場合のクリーンな削除を維持しながら、不要なシャットダウン処理を避けられれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I'm curious if other people are finding that elementsd shutdown takes forever when the node has been running for a very long time, or if this is somehow unique to my machine. It's possible this issue is somehow specific to mac or non-linux platforms; it's also possible it's been made worse by my memory-reducing fix.
What appears to be happening: during shutdown we manually unload the block index, and deallocate the entries, one at a time. This seems basically pointless -- all we're doing is manually freeing memory that will be freed anyway when the process exits. This does not seem to be slow if we've just started, but takes forever when run on a process that's been around for a long time. What I suspect is happening is that the block index has been paged out to disk, and in clearing it we're paging it in, a bit at a time, as we access the entries in random order. Even at SSD speeds, paging in multiple gigabytes using random reads is going to take ages.
(The more problematic possibility is some kind of leak, but I don't see the process having particularly excessive memory usage -- any more than usual -- so I don't think this is it.)
If possible, it would be nice to stop wasting all this effort on shutdown. Assuming it's in fact wasted, one possible catch is the use of the same codepaths in test cases -- we may still need to cleanly delete objects there, if we have to create and destroy multiple block indices before ending the process.
- 主要言語
- C++
- スター
- 1.2k
- フォーク
- 418
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 13
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ElementsProject/elements のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
ElementsProject/elements#1555 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
ElementsProject/elements#1521 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
ElementsProject/elements#1516 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ElementsProject/elements#1502 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
ElementsProject/elements#1500 · コメント 2 件 ·
ElementsProject/elements の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
brave/brave-browser#59300 ·
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main オープンai_reviewed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ydb-platform/ydb#53974 · コメント 3 件 ·