内网两台linux的设备之间传大约100G的文件,以前的土法是win10上分别打开两台机的 SMB目录,然后复制黏贴。
得到的网速大约是 50M/s左右。

photo_2020-08-29_04-17-52.jpg

那么我在想,是不是因为经过我win中间转发上下行让速度折半了呢?
如果让两台linux直接对传,是不是速度会更接近千兆局域网的100M/s 理想速度呢?

弯路

先试了两个方案 scpsftp ,结论是两个都挺慢的,只有 6M/s左右的速度,我还以为我的眼睛看错了。

SFTP

root@omv:~# sftp root@192.168.0.39
The authenticity of host '192.168.0.39 (192.168.0.39)' can't be established.
RSA key fingerprint is SHA256:Uuxp6thxoWZT5pb6CCmyxLVHFyFCd6pw2iJPc7bwrqs.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.39' (RSA) to the list of known hosts.
root@192.168.0.39's password: 
Connected to 192.168.0.39.
sftp> 
sftp> lcd /home/movie/
sftp> cd /mnt/array1/share/new
sftp> get -r *
Fetching /mnt/array1/share/new/Ava.2020.1080p.WEB-DL.DD5.1.H264-FGT/ to Ava.2020.1080p.WEB-DL.DD5.1.H264-FGT
Retrieving /mnt/array1/share/new/Ava.2020.1080p.WEB-DL.DD5.1.H264-FGT
/mnt/array1/share/new/Ava.2020.1080p.WEB-DL.DD5.1.H264-FGT/Ava.2020.1080p.WEB-DL.DD5.1.H26   6%  208MB   5.8MB/s   09:10 ETA

SCP

scp -r root@192.168.0.39:/mnt/array1/share/new/ /home/movie
root@192.168.0.39's password: 
RARBG.txt                                                                                  100%   31     2.0KB/s   00:00    
Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM.mkv                       79% 3401MB   6.5MB/s   02:11 ETA

其他 rsync, nc, dd, gzip数据流压缩之类的就没有再深入研究了。因为两台都是 arm的机器性能不会太强,看上面的数据内容也知道是电影不是文本 压缩不会有太大的帮助。

smb

原本在win下都有50M/s的速度,那linux试试之间直接也走smb看看效果

安装smbclient

apt install smbclient -y

root@omv:~# smbclient -uflamen //192.168.0.39/share/
Enter root's password: 
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-31a.osstech]
smb: \> 
smb: \> cd new
smb: \new\> pwd
Current directory is \\192.168.0.39\share\new\
smb: \new\> lcd /home/movie/test/

尝试下载,不支持通配符 * 报错

smb: \new\> mget *
NT_STATUS_NO_SUCH_FILE listing \new\*
smb: \new\> cd ..
smb: \> mget new
NT_STATUS_NO_SUCH_FILE listing \new

要加多两个命令 promptrecurse

smb: \> prompt
smb: \> recurse
smb: \> mget new
getting file \new\Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM\RARBG.txt of size 31 as RARBG.txt (1.3 KiloBytes/sec) (average 1.3 KiloBytes/sec)
getting file \new\Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM\Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM.mkv of size 4468490577 as Train.to.Busan.2.Peninsula.2020.KOREAN.1080p.WEBRip.DD5.1.x264-CM.mkv (55772.6 KiloBytes/sec) (average 55756.2 KiloBytes/sec)
getting file \new\Rogue.2020.1080p.BluRay.x264.DTS-FGT\RARBG.txt of size 31 as RARBG.txt (1.3 KiloBytes/sec) (average 55739.1 KiloBytes/sec)
getting file \new\Rogue.2020.1080p.BluRay.x264.DTS-FGT\Rogue.2020.1080p.BluRay.x264.DTS-FGT.mkv of size 10316324258 as Rogue.2020.1080p.BluRay.x264.DTS-FGT.mkv (54622.3 KiloBytes/sec) (average 54955.1 KiloBytes/sec)
getting file \new\Hard.Kill.2020.1080p.WEBRip.DD5.1.x264-CM\Hard.Kill.2020.1080p.WEBRip.DD5.1.x264-CM.mkv of size 3089464664 as Hard.Kill.2020.1080p.WEBRip.DD5.1.x264-CM.mkv (51512.0 KiloBytes/sec) (average 54327.4 KiloBytes/sec)

结论是..并没有快,哈哈哈哈。55M/s左右只快了一点点。

瞎折腾 =___=||

标签: linux, samba, smb

添加新评论