Performance issues smb and small files.

mzieba

Cadet
Joined
Aug 27, 2019
Messages
6
Hi Everyone

Processor:
Intel(R) Xeon(R) CPU E5-2643 v3 @ 3.40GHz (12 cores)
Memory:
64 GiB
HDD:
OS: 2x Samsung 883 DCT Series - 240GB SATA 2.5" MZ-7LH240NE
Data: 4x Samsung 883 DCT Series - 3.84TB SATA 2.5" MZ-7LH3T8NE
Raid:
Z1
NIC:
Solareflare Flareon SFN7002F Dual-Port 10GbE

I am having issues with performance on FreeNAS-11.2-U5 particularly with cifs and small files. I am looking to migrate a windows file share server based that hosts small files and folders. Primarily csv files approx. 29.5 KB sample folder I was testing with has approx. 38,500 files and is 1.8GB. The issue I am having is related to a much larger folder with millions of files but I was using this sample set to test the performance of smb on Freenas vs a windows share. I get good performance for large files but not as good as a windows share. Below are the times I am seeing using robocopy. I know samba slows down when it uses small files but I did not expect for performance to be this bad. I have also included a copy of the smb.conf. Ive tried multichannel but it doesn't seem to be working with RSS Receive Side Scaling. If you see the output from the client server using Get-SmbMultichannelConnection, I see its making a multichannel connection, but Client RSS Capable returns False even though the Solarflare card supports RSS. The Windows file share returns True. Furthermore when transferring I also run vmstat -i to see the interrupts and I don't see the interrupts being spread accross the tx/rx queues. Running htop shown smb pegged at 100%. I have scoured the forums for answers and tested tons of parameters to no avail. Am I missing something or is this the type of performance that is expected? Please let me know if I missed any details. Thanks in advance!

Code:
COPY FROM WINDOWS 2012 Host to Freenas SMB SHARE: 1 file (5.6GB)

robocopy source destination /mir /mt:128 /sec /r:0 /w:0 /ns /nc /nfl /ndl /log:c:\freenas.txt

 
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         0         0         0         0
   Files :         2         1         1         0         0         0
   Bytes :   5.662 g   5.662 g    26.0 k         0         0         0
   Times :   0:00:41   0:00:10                       0:00:00   0:00:10
   Ended : Tuesday, August 27, 2019 9:18:02 AM




COPY FROM WINDOWS 2012 HOST > Windows 2012 RAID 5 SSD SHARE: 1 file (5.6GB)
robocopy source destination /mir /mt:128 /sec /r:0 /w:0 /ns /nc /nfl /ndl /log:c:\freenas.txt

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         0         0         0         0
   Files :         2         2         0         0         0         0
   Bytes :   5.662 g   5.662 g         0         0         0         0
   Times :   0:00:10   0:00:02                       0:00:00   0:00:02
   Ended : Tuesday, August 27, 2019 9:19:37 AM




COPY FROM WINDOWS 2012 Host to Freenas SMB SHARE: (38477 files 1.8GB)

robocopy source destination /mir /mt:128 /sec /r:0 /w:0 /ns /nc /nfl /ndl /log:c:\freenas.txt

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :       333       333       332         0         0         0
   Files :     38477     38476         1         0         0         0
   Bytes :   1.814 g   1.814 g    26.0 k         0         0         0
   Times :   4:30:01   0:02:06                       0:00:00   0:00:01
   Ended : Tuesday, August 27, 2019 9:33:53 AM



COPY FROM WINDOWS 2012 Host to Freenas SMB SHARE: (38477 files 1.8GB)

robocopy source destination /mir /mt:128 /sec /r:0 /w:0 /ns /nc /nfl /ndl /log:c:\freenas.txt
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :       333       333       332         0         0         0
   Files :     38477     38476         1         0         0         1
   Bytes :   1.814 g   1.814 g    26.0 k         0         0   5.662 g
   Times :   0:17:31   0:00:08                       0:00:00   0:00:00
   Ended : Tuesday, August 27, 2019 9:25:37 AM


OUTPUT FROM CLIENT: Get-SmbMultichannelConnection

Server Name   Selected        Client IP   Server IP    Client Interface Index Server Interface Index Client RSS Capable Client RDMA Capable
-----------     -------- ---------   ---------    ---------------------- ---------------------- ------------------ -------------------
FREENAS               True     10.24.14.70 10.24.14.211    17                       8                      False              False
WINDOWS FILE SHARE   True     10.24.14.70 10.24.14.164    17                     19                      True               False


smb.conf


[global]
        aio max threads = 2
        allow trusted domains = No
        client ldap sasl wrapping = plain
        deadtime = 15
        disable spoolss = Yes
        dns proxy = No
        domain master = No
        dos charset = CP437
        hostname lookups = Yes
        kernel change notify = No
        lm announce = Yes
        load printers = No
        local master = No
        logging = file
        max log size = 51200
        max open files = 1883558
        nsupdate command = /usr/local/bin/samba-nsupdate -g
        obey pam restrictions = Yes
        preferred master = No
        printcap name = /dev/null
        realm = DOMAIN.COM
        security = ADS
        server min protocol = SMB2_02
        server multi channel support = Yes
        server role = member server
        server string = FreeNAS Server
        template shell = /bin/sh
        winbind cache time = 7200
        winbind enum groups = Yes
        winbind enum users = Yes
        winbind offline logon = Yes
        winbind refresh tickets = Yes
        workgroup = DOMAIN
        idmap config domain: range = 20000-90000000
        idmap config domain: backend = rid
        idmap config *: range = 90000001-100000000
        idmap config * : backend = tdb
        acl allow execute always = Yes
        create mask = 0666
        directory mask = 0777
        directory name cache size = 0
        dos filemode = Yes
        strict locking = No


[root_shares]
        aio write size = 0
        path = "/mnt/pool1/root_shares"
        read only = No
        veto files = /.snapshot/.windows/.mac/.zfs/
        vfs objects = zfs_space zfsacl streams_xattr
        zfsacl:acesort = dontcare
        nfs4:chown = true
        nfs4:acedup = merge
        nfs4:mode = special
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
A couple of changes to try:
1) create new dataset with case sensitivity set to "insensitive"
2) remove zfs_space and zfs_acl. Replace with "ixnas"
3) add auxiliary parameter to share "case sensitive = true"

At present don't use multichannel with production data.

(1) - (3) optimizations for some metadata operations. At 100% CPU for a single smbd, it's pretty clear where the bottleneck is, but it's not clear what the smbd is doing. You can use smbstatus to get the PID of the smbd process. You can use procsystime to get some rough numbers for syscalls: http://www.brendangregg.com/DTrace/procsystime

Feel free to post your output here.

If you're spending all your time in pwrite(), then try enabling aio writes by adding the following auxiliary parameter for the share: 'aio write size = 1' and increase 'aio max threads' to 10 under Service->SMB Auxiliary parameters.
 

mzieba

Cadet
Joined
Aug 27, 2019
Messages
6
Thank you for your quick reply!

Setting the recommended settings above I was able to shave off about a minute. I have also run procsystime and the results are below.

1) create new dataset with case sensitivity set to "insensitive"
2) remove zfs_space and zfs_acl. Replace with "ixnas"
3) add auxiliary parameter to share "case sensitive = true"
4.) aio max threads = 10 under Service->SMB Auxiliary parameters.
5.) aio write size = 1




Code:
COPY FROM WINDOWS 2012 Host to Freenas SMB SHARE: (38477 files 1.8GB)
------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :       332       332       330         0         0         0
   Files :     38476     38475         1         0         0         0
   Bytes :   1.814 g   1.814 g    76.5 k         0         0         0
   Times :   2:32:03   0:01:11                       0:00:00   0:00:00
   Ended : Tuesday, August 27, 2019 2:07:28 PM


[~]# ./procsystime -p 33859
Hit Ctrl-C to stop sampling...
dtrace: 452 dynamic variable drops with non-empty dirty list
dtrace: 62523 dynamic variable drops with non-empty dirty list
dtrace: 111837 dynamic variable drops with non-empty dirty list
dtrace: 109949 dynamic variable drops with non-empty dirty list
dtrace: 103577 dynamic variable drops with non-empty dirty list
dtrace: 124080 dynamic variable drops with non-empty dirty list
dtrace: 130724 dynamic variable drops with non-empty dirty list
dtrace: 120130 dynamic variable drops with non-empty dirty list
dtrace: 115043 dynamic variable drops with non-empty dirty list
dtrace: 114335 dynamic variable drops with non-empty dirty list
dtrace: 122070 dynamic variable drops with non-empty dirty list
dtrace: 117769 dynamic variable drops with non-empty dirty list
dtrace: 123476 dynamic variable drops with non-empty dirty list
dtrace: 120516 dynamic variable drops with non-empty dirty list
dtrace: 116226 dynamic variable drops with non-empty dirty list
dtrace: 92585 dynamic variable drops with non-empty dirty list
dtrace: 85443 dynamic variable drops with non-empty dirty list
dtrace: 87547 dynamic variable drops with non-empty dirty list
dtrace: 97206 dynamic variable drops with non-empty dirty list
dtrace: 89677 dynamic variable drops with non-empty dirty list
dtrace: 90761 dynamic variable drops with non-empty dirty list
dtrace: 90534 dynamic variable drops with non-empty dirty list
dtrace: 100218 dynamic variable drops with non-empty dirty list
dtrace: 113795 dynamic variable drops with non-empty dirty list
dtrace: 113643 dynamic variable drops with non-empty dirty list
dtrace: 111776 dynamic variable drops with non-empty dirty list
dtrace: 110596 dynamic variable drops with non-empty dirty list
dtrace: 83722 dynamic variable drops with non-empty dirty list
dtrace: 90690 dynamic variable drops with non-empty dirty list
dtrace: 102420 dynamic variable drops with non-empty dirty list
dtrace: 112836 dynamic variable drops with non-empty dirty list
dtrace: 113321 dynamic variable drops with non-empty dirty list
dtrace: 111723 dynamic variable drops with non-empty dirty list
dtrace: 106691 dynamic variable drops with non-empty dirty list
dtrace: 99524 dynamic variable drops with non-empty dirty list
dtrace: 81837 dynamic variable drops with non-empty dirty list
dtrace: 92543 dynamic variable drops with non-empty dirty list
dtrace: 90202 dynamic variable drops with non-empty dirty list
dtrace: 91408 dynamic variable drops with non-empty dirty list
dtrace: 90326 dynamic variable drops with non-empty dirty list
dtrace: 91712 dynamic variable drops with non-empty dirty list
dtrace: 107748 dynamic variable drops with non-empty dirty list
dtrace: 109017 dynamic variable drops with non-empty dirty list
dtrace: 106976 dynamic variable drops with non-empty dirty list
dtrace: 99934 dynamic variable drops with non-empty dirty list
dtrace: 95503 dynamic variable drops with non-empty dirty list
dtrace: 106587 dynamic variable drops with non-empty dirty list
dtrace: 104581 dynamic variable drops with non-empty dirty list
dtrace: 109795 dynamic variable drops with non-empty dirty list
dtrace: 109208 dynamic variable drops with non-empty dirty list
dtrace: 109946 dynamic variable drops with non-empty dirty list
dtrace: 110768 dynamic variable drops with non-empty dirty list
dtrace: 108559 dynamic variable drops with non-empty dirty list
dtrace: 108419 dynamic variable drops with non-empty dirty list
dtrace: 107660 dynamic variable drops with non-empty dirty list
dtrace: 107618 dynamic variable drops with non-empty dirty list
dtrace: 107603 dynamic variable drops with non-empty dirty list
dtrace: 94352 dynamic variable drops with non-empty dirty list
dtrace: 93025 dynamic variable drops with non-empty dirty list
dtrace: 93556 dynamic variable drops with non-empty dirty list
dtrace: 93727 dynamic variable drops with non-empty dirty list
dtrace: 98971 dynamic variable drops with non-empty dirty list
dtrace: 109603 dynamic variable drops with non-empty dirty list
dtrace: 111106 dynamic variable drops with non-empty dirty list
dtrace: 111430 dynamic variable drops with non-empty dirty list
dtrace: 106119 dynamic variable drops with non-empty dirty list
dtrace: 111206 dynamic variable drops with non-empty dirty list
dtrace: 110993 dynamic variable drops with non-empty dirty list
dtrace: 111632 dynamic variable drops with non-empty dirty list
dtrace: 109785 dynamic variable drops with non-empty dirty list
dtrace: 107685 dynamic variable drops with non-empty dirty list
dtrace: 92516 dynamic variable drops with non-empty dirty list
dtrace: 90715 dynamic variable drops with non-empty dirty list
dtrace: 28334 dynamic variable drops with non-empty dirty list
dtrace: 265 dynamic variable drops with non-empty dirty list
dtrace: 3282 dynamic variable drops with non-empty dirty list
dtrace: 1342 dynamic variable drops with non-empty dirty list
^C

Elapsed Times for PID 33859,

         SYSCALL          TIME (ns)
         modfind               5272
          statfs               8063
         recvmsg              10562
extattr_list_fd              16415
            open              18712
          socket              29155
posix_fallocate              34123
            mmap             109108
         connect             142982
         fstatfs             162144
          getpid             343072
           ioctl             458991
            kill             571027
          munmap            1060955
           pread            1252400
           mkdir            2001430
   getdirentries            2235051
       getgroups            8992951
           write           10268227
         madvise           15745253
        __sysctl           15881944
           close           15959264
          fchmod           20792871
         fstatat           21183440
        setregid           22600839
       setgroups           23816327
         getegid           28932127
         geteuid           30578012
        setreuid           34021619
       ftruncate           49801033
           fstat           63865473
extattr_list_file           67536054
           fcntl           75318020
  __acl_set_file           91012906
         chflags           96288239
           chdir          104131198
            read          144641568
          openat          159622147
         sendmsg          191692529
          pwrite          203416651
        __getcwd          257651418
           readv          364104069
          writev          394639139
       utimensat          466996366
  __acl_get_file          606067205
           lstat         1599799827
            stat         1686167554
            poll        22839035408
        _umtx_op        49118126077
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Retry with aio parameters removed (leave ixnas and other changes. make sure to restart samba) and gather procsystime again. The instrumentation in procsystime will probably adversely affect performance but it will give an idea of what's going on.
 

mzieba

Cadet
Joined
Aug 27, 2019
Messages
6
No Problem. Output is below.

Code:
COPY FROM WINDOWS 2012 Host to Freenas SMB SHARE: (38477 files 1.8GB)
------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :       332       332       330         0         0         0
   Files :     38476     38475         1         0         0         0
   Bytes :   1.814 g   1.814 g    76.5 k         0         0         0
   Times :   2:38:05   0:01:13                       0:00:00   0:00:00
   Ended : Tuesday, August 27, 2019 2:32:35 PM


[~]# ./procsystime -p 37433
Hit Ctrl-C to stop sampling...
dtrace: 66444 dynamic variable drops with non-empty dirty list
dtrace: 105262 dynamic variable drops with non-empty dirty list
dtrace: 108821 dynamic variable drops with non-empty dirty list
dtrace: 93237 dynamic variable drops with non-empty dirty list
dtrace: 90018 dynamic variable drops with non-empty dirty list
dtrace: 107782 dynamic variable drops with non-empty dirty list
dtrace: 128646 dynamic variable drops with non-empty dirty list
dtrace: 126253 dynamic variable drops with non-empty dirty list
dtrace: 127175 dynamic variable drops with non-empty dirty list
dtrace: 127054 dynamic variable drops with non-empty dirty list
dtrace: 127752 dynamic variable drops with non-empty dirty list
dtrace: 130085 dynamic variable drops with non-empty dirty list
dtrace: 129446 dynamic variable drops with non-empty dirty list
dtrace: 95838 dynamic variable drops with non-empty dirty list
dtrace: 81605 dynamic variable drops with non-empty dirty list
dtrace: 86882 dynamic variable drops with non-empty dirty list
dtrace: 101286 dynamic variable drops with non-empty dirty list
dtrace: 102757 dynamic variable drops with non-empty dirty list
dtrace: 86123 dynamic variable drops with non-empty dirty list
dtrace: 89945 dynamic variable drops with non-empty dirty list
dtrace: 90674 dynamic variable drops with non-empty dirty list
dtrace: 89189 dynamic variable drops with non-empty dirty list
dtrace: 101665 dynamic variable drops with non-empty dirty list
dtrace: 93461 dynamic variable drops with non-empty dirty list
dtrace: 91236 dynamic variable drops with non-empty dirty list
dtrace: 93675 dynamic variable drops with non-empty dirty list
dtrace: 103939 dynamic variable drops with non-empty dirty list
dtrace: 85337 dynamic variable drops with non-empty dirty list
dtrace: 95182 dynamic variable drops with non-empty dirty list
dtrace: 98454 dynamic variable drops with non-empty dirty list
dtrace: 90719 dynamic variable drops with non-empty dirty list
dtrace: 92293 dynamic variable drops with non-empty dirty list
dtrace: 91456 dynamic variable drops with non-empty dirty list
dtrace: 92020 dynamic variable drops with non-empty dirty list
dtrace: 92171 dynamic variable drops with non-empty dirty list
dtrace: 95346 dynamic variable drops with non-empty dirty list
dtrace: 79761 dynamic variable drops with non-empty dirty list
dtrace: 80835 dynamic variable drops with non-empty dirty list
dtrace: 81473 dynamic variable drops with non-empty dirty list
dtrace: 79824 dynamic variable drops with non-empty dirty list
dtrace: 81817 dynamic variable drops with non-empty dirty list
dtrace: 107762 dynamic variable drops with non-empty dirty list
dtrace: 110519 dynamic variable drops with non-empty dirty list
dtrace: 91356 dynamic variable drops with non-empty dirty list
dtrace: 90924 dynamic variable drops with non-empty dirty list
dtrace: 91660 dynamic variable drops with non-empty dirty list
dtrace: 99607 dynamic variable drops with non-empty dirty list
dtrace: 112876 dynamic variable drops with non-empty dirty list
dtrace: 112818 dynamic variable drops with non-empty dirty list
dtrace: 112359 dynamic variable drops with non-empty dirty list
dtrace: 112902 dynamic variable drops with non-empty dirty list
dtrace: 103016 dynamic variable drops with non-empty dirty list
dtrace: 99231 dynamic variable drops with non-empty dirty list
dtrace: 101450 dynamic variable drops with non-empty dirty list
dtrace: 92745 dynamic variable drops with non-empty dirty list
dtrace: 91561 dynamic variable drops with non-empty dirty list
dtrace: 89829 dynamic variable drops with non-empty dirty list
dtrace: 92792 dynamic variable drops with non-empty dirty list
dtrace: 95067 dynamic variable drops with non-empty dirty list
dtrace: 92668 dynamic variable drops with non-empty dirty list
dtrace: 93135 dynamic variable drops with non-empty dirty list
dtrace: 91008 dynamic variable drops with non-empty dirty list
dtrace: 90124 dynamic variable drops with non-empty dirty list
dtrace: 89684 dynamic variable drops with non-empty dirty list
dtrace: 91227 dynamic variable drops with non-empty dirty list
dtrace: 103848 dynamic variable drops with non-empty dirty list
dtrace: 89006 dynamic variable drops with non-empty dirty list
dtrace: 90317 dynamic variable drops with non-empty dirty list
dtrace: 90691 dynamic variable drops with non-empty dirty list
dtrace: 92148 dynamic variable drops with non-empty dirty list
dtrace: 90531 dynamic variable drops with non-empty dirty list
dtrace: 88680 dynamic variable drops with non-empty dirty list
dtrace: 86518 dynamic variable drops with non-empty dirty list
dtrace: 80996 dynamic variable drops with non-empty dirty list
dtrace: 81007 dynamic variable drops with non-empty dirty list
dtrace: 2260 dynamic variable drops with non-empty dirty list
^C

Elapsed Times for PID 37433,

         SYSCALL          TIME (ns)
        readlink               1768
         recvmsg               3806
          socket               5795
         connect              24556
 posix_fallocate             102933
            mmap             105408
         fstatfs             145327
          getpid             391238
          munmap             478698
            kill             628071
           pread            1446913
           mkdir            1593255
   getdirentries            2374282
         madvise            7736346
       getgroups            9087017
           close           16059285
        __sysctl           16376417
          fchmod           22523076
         fstatat           23175544
        setregid           23217535
       setgroups           24843116
         getegid           28298501
         geteuid           31207524
        setreuid           35219061
       ftruncate           51162541
           fstat           63279585
           fcntl           76634000
extattr_list_file           86806615
  __acl_set_file          103753124
         chflags          107623250
           chdir          129614202
            read          149246221
          openat          172978635
          pwrite          201891836
         sendmsg          212330102
        __getcwd          308099465
           readv          331959101
          writev          421367463
       utimensat          547810788
  __acl_get_file          757799385
           lstat         1873981043
            stat         2066810979
            poll         4542227735
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hi Just following up here.

I gave you parameters that will be the default in 11.3. I added some more optimizations in ACL-related code in 11.3, but they aren't present in 11.2. Feel free to open a ticket on our bug tracker. Troubleshooting particular configuration details and optimizations is beyond scope of help I can provide in the forums.
 
Top