ファイルサイズが64KBを超えると、scp転送速度が非常に遅くなります。

ファイルサイズが64KBを超えると、scp転送速度が非常に遅くなります。

最初の問題は、git cloneSSHを介して実行すると、転送速度が非常に遅く、一時停止し、最終的に失敗することです。

connection reset via peer

背景

  • SSH サーバーは Raspbian を実行する Raspberry Pi です。
  • sshクライアントOSXとRaspbianを使用する別のRaspberryを試しましたが、同じ問題があります
  • git cloneLANでは問題ありませんでしたが、WAN経由で試してみると問題が発生します。 WANアクセス用にRaspberry PiのSSHポートをルーターに公開するポート転送機能を備えたopenWrtルーターがあります。
  • インターネットで見えるルーターでファイアウォールが実行されています。
  • IPv4の使用
  • RPiは有線接続を介してルータに接続されます。
  • 次のSSHクライアントが使用されます。
    • オペレーティングシステム:OpenSSH_8.1p1, LibreSSL 2.7.3
    • 回転速度:openssh-client/stable,now 1:7.9p1-10 armhf

scpo観察scp見る前に正しく動作していることを確認してみましょうgit clone。私の観察は次のとおりです。

scp64KB未満のファイルは非常に迅速に処理され、1秒以内に完了します。

scp -P 31415 user@host:/tmp/64KB /dev/null

64KB                 100%   64KB 310.4KB/s   00:00

scp64KBより大きいファイルは非常に遅く、1KBだけを追加しても失敗することがあります。

scp -P 31415 user@host:/tmp/65KB /dev/null

65KB                 100%   65KB 284.2KB/s   00:00
Connection to xxxxxxx closed by remote host.

scp -vvv2つの伝送を比較したところ、次の違いがわかりました。

-64KB                                              100%   64KB 288.5KB/s   00:00
+65KB                                              100%   65KB 267.3KB/s   00:00
 debug3: receive packet: type 96
 debug2: channel 0: rcvd eof
 debug2: channel 0: output open -> drain
@@ -190,6 +190,18 @@ debug2: channel 0: chan_shutdown_read (i0 o3 sock -1 wfd 4 efd 6 [write])
 debug2: channel 0: input open -> closed
 debug3: receive packet: type 97
 debug2: channel 0: rcvd close
+debug3: receive packet: type 98
+debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
+debug3: send packet: type 100
+debug3: receive packet: type 98
+debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
+debug3: send packet: type 100
+debug3: receive packet: type 98
+debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
+debug3: send packet: type 100
+debug3: receive packet: type 98
+debug1: client_input_channel_req: channel 0 rtype [email protected] reply 1
+debug3: send packet: type 100
 debug3: channel 0: will not send data after close
 debug2: channel 0: almost dead
 debug2: channel 0: gc: notify user

65KBについていくつかの追加コンテンツがありますが、+debug3: receive packet: type 98それを解釈するのに十分な理解がありません。

TCPTimestampsをオフにする、MTUのサイズを変更するなど、いくつかの解決策を試しましたが、その何も役に立ちませんでした。

ベストアンサー1

「IPQoS」を「なし」に設定すると問題が解決しました。とても感謝しています!クライアントとサーバーの両方でこのオプションを設定する必要があるようです。

おすすめ記事