V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要把任何和邀请码有关的内容发到 NAS 节点。

邀请码相关的内容请使用 /go/in 节点。

如果没有发送到 /go/in,那么会被移动到 /go/pointless 同时账号会被降权。如果持续触发这样的移动,会导致账号被禁用。
bbbb
V2EX  ›  NAS

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

  •  
  •   bbbb · 2018-11-19 18:51:11 +08:00 · 3547 次点击
    这是一个创建于 2177 天前的主题,其中的信息可能已经有所发展或是发生改变。

    将 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 配置暂时没找到

    2 条回复    2018-11-29 16:11:13 +08:00
    Sylv
        1
    Sylv  
       2018-11-29 08:18:29 +08:00 via iPhone   ❤️ 1
    create mask 等权限设置要配置 inherit permissions = no 才管用,否则会继承父目录的权限。
    bbbb
        2
    bbbb  
    OP
       2018-11-29 16:11:13 +08:00
    @Sylv 谢谢。我试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5448 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:00 · PVG 15:00 · LAX 23:00 · JFK 02:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.