改善FreeFileSync在SFTP中的傳輸效能

簡述一下我使用FreeFileSync和SFTP的傳輸情境。

PC

  1. Apache Web Server:公開的Blog網站。
  2. Bitvise SSH Server:接收Hexo建立好的靜態網頁資料。
  3. 固網:中華電信300M。

MacBook Pro

  1. Hexo:本機的Blog網站資料。
  2. FreeFileSync:上傳Hexo建立好的靜態網頁資料。
  3. 行動網路:LINE MOBILE 10M吃到飽。

FreeFileSync設定

  • 比對檔案內容。
  • 鏡像同步。
  • 資料為100MB的零碎小檔。

SFTP效能設定跑預設值:

  • 連線數:1
  • 每個連接SFTP通道數:1

ffs sftp default settings

傳輸速度慘不忍睹,跑不到300KB/s,傳輸時間超過10分鐘。
ffs sftp transmission slow

將SFTP效能設定改成以下數值:

  • 連線數:10
  • 每個連接SFTP通道數:5

ffs sftp new settings

傳輸速度直接飆升,10M行動網路輕易的跑到破表。
ffs sftp transmission fast

FreeFileSync官方對於「Configure SFTP for Best Performance」的解說:
https://freefilesync.org/manual.php?topic=ftp-setup

By default, FreeFileSync creates one connection to the server and uses one SFTP channel, i.e. only a single SFTP command can be sent and received at a time. Since most of this time is spent waiting due to the high latency of the remote connection, you can speed up reading large folder hierarchies by increasing both the connection and channel count.

有些軟體還是要研究一下,不要像我一樣懶,傻傻跑預設值XD