MyCloud samba3 的传输速度为啥是 nfs 性能的一倍?那里操作有问题?

2018-11-19 18:51:11 +08:00
 bbbb

将 mycloud 通过 samba 和 nfs 挂载到一台 centos7 到机器上,用 dd 测速,传输速度相差一倍,测速多次也一样。samba3 明显快,这是 3 做了改动么?另复制进去的文件权限改变了。按照查询的进行更改(添加 map 啥的)无效。

查询好像和下面 4 个设置相关,正在测试。。。有老哥能给点提醒么?想实现点挂载后和普通硬盘一样,权限不变,性能插不了多少。

create mask = 0777 
directory mask  = 0777 
force create mode = 0777 
force directory mode = 0777

挂载

//192.168.3.24/data     2.7T  122G  2.6T   5% /mnt/data
192.168.3.24:/nfs/data  2.7T   94G  2.6T   4% /root/data

dd 测速

samba

~ # dd if=/dev/zero of=/mnt/data/test1.img bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 12.5367 s, 85.6 MB/s

nfs

~ # dd if=/dev/zero of=/root/data/test2.img bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 24.5374 s, 43.8 MB/s

权限问题

samba

~ # ls -la /mnt/data 
total 2097156
drwxr-xr-x. 2 root root          0 Nov 19 18:24 .
drwxr-xr-x. 3 root root         18 Nov 17 19:45 ..
-rwxr-xr-x. 1 root root       1679 Nov 19 18:24 id_rsa
-rwxr-xr-x. 1 root root        398 Nov 19 18:24 id_rsa.pub
-rwxr-xr-x. 1 root root 1073741824 Nov 19 18:03 test1.img
-rwxr-xr-x. 1 root root 1073741824 Nov 19 18:06 test2.img

nfs

~ # ls -la data

total 2097164
drwxrwxrwx+  2 root root       4096 Nov 19 18:24 .
dr-xr-x---. 15 root root       4096 Nov 19 18:24 ..
-rwxrwxrwx.  1 1002 1000       1679 Nov 19 18:24 id_rsa
-rw-r--r--.  1  501 1000        398 Nov 19 18:24 id_rsa.pub
-rwxrwxrwx.  1 1002 1000 1073741824 Nov 19 18:03 test1.img
-rw-rw-rw-.  1  501 1000 1073741824 Nov 19 18:06 test2.img

samba3 相关配置

[ global ]
netbios name = WDMyCloud
server string = WDMyCloud
veto files = /:2eDS_Store/.bin/Network Trash Folder/.systemfile/lost+found/Nas_Prog/mirrored/uploaded/.wdmc/.AppleDouble/
workgroup = WORKGROUP
security = user
passdb backend = smbpasswd
ldap ssl = no
local master = yes
os level = 33
preferred master = yes
smb2 leases = yes
fruit:copyfile= yes
printing = bsd
printcap name = /dev/null
disable spoolss = yes
max protocol = SMB3
max xmit = 131072
max log size = 10
log level = 0
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=2097152 SO_SNDBUF=2097152
delete veto files = yes
unix charset = UTF8
encrypt passwords = yes
map to guest = bad user
null passwords = yes
guest account = nobody
dns proxy = no
use mmap = yes
use spnego = yes
disable netbios = no
strict allocate = yes
csc policy = disable
min receivefile size = 16k
allocation roundup size = 0
create mask = 0777
directory mask  = 0777
force create mode = 0777
force directory mode = 0777
use sendfile = yes
smb passwd file = /etc/samba/smbpasswd
disable spoolss = yes
nt acl support = yes
acl map full control = yes
load printers = no
unix extensions = no
follow symlinks = yes
wide links = yes
printable = no
include = /etc/samba/tm_config.conf
[ data ]
comment = xxxx
path = /mnt/HD/HD_a2/data
browseable = yes
public = no
available = yes
oplocks = yes
map archive = no
read list =
write list = "data"
invalid users = "nobody","admin","xxxx"
valid users = "data"
# !!properties = "remote_access"

nfs 配置暂时没找到

3450 次点击
所在节点    NAS
2 条回复
Sylv
2018-11-29 08:18:29 +08:00
create mask 等权限设置要配置 inherit permissions = no 才管用,否则会继承父目录的权限。
bbbb
2018-11-29 16:11:13 +08:00
@Sylv 谢谢。我试试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/509360

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX