parasyncをやめた
parasyncというrsyncを並列実行して高速化するツールを書いてたけれど、rsyncdを立ち上げないとならないので、新自宅鯖ではやめました。代わりにrcloneを使うようにしました。
インストールと設定
まずインストール。
brew install rclonercloneクライアントを設定します。
rclone config create new-server sftp \
host 192.168.1.4 \
user rio \
key_file ~/.ssh/id_ed25519ドライランと本番
で、ドライラン。MacStudioの外付けSSDから、サーバに同期します。
rclone sync /Volumes/4TBSSD/Photos_and_Videos/ \
new-server:/opt/data/Photos_and_Videos/ \
--dry-run \
--progress \
--stats 30s \
--transfers 16 \
--checkers 64 \
--multi-thread-streams 4 \
--multi-thread-cutoff 256M \
--exclude ".DS_Store" \
--exclude "._*" \
--exclude ".Spotlight-V100/**" \
--exclude ".Trashes/**" \
--exclude ".fseventsd/**"特に問題は無さそうなので、本番。
rclone sync /Volumes/4TBSSD/Photos_and_Videos/ \
new-server:/opt/data/Photos_and_Videos/ \
--progress \
--stats 30s \
--transfers 16 \
--checkers 64 \
--multi-thread-streams 4 \
--multi-thread-cutoff 256M \
--exclude ".DS_Store" \
--exclude "._*" \
--exclude ".Spotlight-V100/**" \
--exclude ".Trashes/**" \
--exclude ".fseventsd/**"結果は平均約 395MiB/s、3.31Gbps。このままで良いけれど、10Gbps接続としてはちょっと遅いかな。
チューニング
AIエージェントに所与の条件を渡して、チューニングさせます。
rcloneのパラメータの最適化をしたい。パラメータの意味するところを精査しながら変更して欲しい。実際にチューニングに使ったのは、上記の/Volumes/4TBSSD/Photos_and_Videos/2024/で、3832ファイル、155GBほどのディレクトリ。
| 試行 | 主な変更 | 平均速度 |
|---|---|---|
| baseline | transfers 16 / mt 4 | 395 MiB/s |
| best | transfers 8 / mt 4 | 415 MiB/s |
| mt増加 | transfers 8 / mt 8 / cutoff 128M | 229 MiB/s |
| transfers増加 | transfers 12 / mt 4 | 220 MiB/s |
| SFTP concurrency低下 | transfers 8 / sftp-concurrency 32 | 210 MiB/s |
| 低並列 | transfers 4 / mt 1 | 180 MiB/s |
| sftp chunk 256Ki | 接続断多発 | 不採用 |
415MiB/s、3.48Gbs。parasyncよりは遅いけど、管理の手間が減るので良しとしましょう。
rclone sync /Volumes/4TBSSD/Photos_and_Videos/ \
new-server:/opt/data/Photos_and_Videos/ \
--progress \
--stats 30s \
--transfers 8 \
--checkers 64 \
--multi-thread-streams 4 \
--multi-thread-cutoff 256M \
--exclude ".DS_Store" \
--exclude "._*" \
--exclude ".Spotlight-V100/**" \
--exclude ".Trashes/**" \
--exclude ".fseventsd/**"

