perf(sftp): adopt the russh-sftp borrowed write API in upload dispatch
メンテナーはふだん 1 日以内に返信
@inureyes がすでに取り組んでいます。
2026年11月5日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- cli, performance
調査の方向性
Start with src/ssh/tokio_client/sftp_client.rs and read write_all_pipelined, then check whether a russh-sftp release exposes write_nowait_from_slice and Request; the issue says not to start before that release is available. Adapt the upload reader and bounded acknowledgement window while preserving #321's throttling, and run the existing upload tests. Done means file and stdin uploads work and the #322 benchmark reaches within about 5% of upstream io::copy_buf throughput.
索引モデルが issue の本文から書いたものです。
説明
Problem / Background
Issue #322 profiled the SFTP upload pipeline against upstream russh-sftp's own copy path (local sftp-server, RTT 0). bssh's SftpClient::upload_from reaches 78-85% of upstream throughput, and roughly 10% of the gap comes from a double copy per chunk: write_all_pipelined (src/ssh/tokio_client/sftp_client.rs) reads into a freshly allocated owned Vec, then the write call serializes that buffer a second time into the outgoing frame.
The fix needs a borrowed, non-awaiting write API that russh-sftp currently keeps private (RawSftpSession::write_nowait_from_slice and the Request handle are pub(crate)). Upstream PR AspectUnk/russh-sftp#105 ("feat(client): expose the borrowed, non-awaiting write") makes both public and re-exports Request from russh_sftp::client. This issue is blocked on that PR being merged and released; as of 2026-10-20 its workflow runs were still awaiting maintainer approval, so expect the wait to take a while. Do not start before a russh-sftp release containing it is available.
Proposed Solution
- Bump the russh-sftp dependency to a release containing AspectUnk/russh-sftp#105.
- Rework write_all_pipelined to take an AsyncBufRead reader, dispatch each fill_buf slice with write_nowait_from_slice (no per-chunk Vec allocation, one copy per chunk), and keep a bounded window (VecDeque) of the returned Request handles, awaiting the oldest ack when the window fills so the backpressure behavior added in #321 is preserved.
- Adapt non-buffered sources (tokio's File does not implement AsyncBufRead) so file and stdin uploads keep working, for example with a BufReader wrapper.
- Out of scope: the residual multi-threaded scheduling margin measured in #322 (worker handoff cost). This issue only targets the double-copy gap.
Acceptance Criteria
- The upload path dispatches directly from the reader's borrowed buffer: no per-chunk owned allocation, one copy per chunk.
- The russh-sftp dependency is updated to a release that publicly exposes write_nowait_from_slice and Request.
- The in-flight window stays bounded with oldest-first ack collection, and #321's throttle behavior is preserved.
- File and stdin uploads still work (AsyncBufRead adaptation for non-buffered readers), and existing upload tests pass.
- The #322 benchmark scenario (local sftp-server, RTT 0, single-threaded runtime) shows the double-copy gap recovered: throughput within about 5% of the upstream io::copy_buf path.
- 主要言語
- Rust
- スター
- 71
- フォーク
- 7
- 平均マージ
- 4時間 51分
- マージ済み PR(30日)
- 14
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lablup/bssh のほかの issue
-
feat(ssh): add webauthn-sk host-key support対応中かも @inureyes が 24 日前に担当しました。 オープンpriority:low status:blocked type:enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
fix(security): enforce sk-* UP and UV flags once russh exposes the signature対応中かも @inureyes が 24 日前に担当しました。 オープンpriority:medium status:blocked type:security
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
fix(security): verify the server host key presented on re-key対応中かも @inureyes が 24 日前に担当しました。 オープンpriority:low status:blocked type:security
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
feat(agent): bind destination-constrained agent keys with [email protected]対応中かも @inureyes が 24 日前に担当しました。 オープンpriority:medium status:blocked type:enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
feat: Implement real-time streaming output with interactive multi-node UI対応中かも @inureyes が 396 日前に担当しました。 オープンpriority:medium status:backlog type:enhancement
メンテナーはふだん 1 日以内に返信
似ている issue
-
area:ui effort:medium enhancement P7 source:agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
documentation priority: low tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
nledford/Ladderback#1823 ·
メンテナーはふだん 1 日以内に返信
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)対応中かも @ealwanlee が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
psmux/psmux-plugins#47 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信