# FreeBSD 9.0-RC1+ZFS+Samba3.5+AD slow working



## G_Nerc (Oct 27, 2011)

Good day!
Please help me with problem:
*Hardware:* Phenom X6 + 16Gb Ram + 4*2Tb HDD [RAIDZ]
*OS:* FreeBSD 9.0-RC1 amd64 (without debugging)
When i copy many small files on samba-resource  speed is about 0-3Mbit/s (1Mbit=125000 Byte/sec for quiestions Mbit/sec or MByte/sec), and big files from another computers to samba-resource copies with speed about 50-60Mbit/sec. Clients have 100Mbit LAN, Server in 1GBit port
Samba 3.5.11

```
WITH_LDAP=true
WITH_ADS=true
WITHOUT_CUPS=true
WITH_WINBIND=true
WITHOUT_SWAT=true
WITHOUT_ACL_SUPPORT=true
WITHOUT_AIO_SUPPORT=true
WITHOUT_FAM_SUPPORT=true
WITHOUT_SYSLOG=true
WITHOUT_QUOTAS=true
WITHOUT_UTMP=true
WITHOUT_PAM_SMBPASS=true
WITHOUT_DNSUPDATE=true
WITHOUT_AVAHI=true
WITHOUT_EXP_MODULES=true
WITH_POPT=true
WITHOUT_IPV6=true
WITHOUT_MAX_DEBUG=true
WITHOUT_SMBTORTURE=true
```
smb.conf

```
#======================= Global Settings =====================================
[global]
workgroup       = DOMAIN
server string   = ZFS FreeBSD file server
netbios name    = BSD-zfs
security        = ads
auth methods    = winbind

hosts allow     = 192.168.10.0/24 127.0.0.1/32
smb ports       = 445

load printers   = no
show add printer wizard = no

log file        = /dev/null

max log size    = 128

password server = 192.168.10.1

realm           = domain.local

passdb backend  = tdbsam

socket options  = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=32768 SO_SNDBUF=32768
getwd cache     = yes
use sendfile    = true

interfaces      = 192.168.10.8/24

local master    = no
os level        = 33
domain master   = no
preferred master        = no
domain logons   = no

winbind use default domain      = yes
winbind uid     = 10000 - 15000
winbind gid     = 10000 - 15000
winbind enum users      = yes
winbind enum groups     = yes
winbind separator       = +
winbind cache time      = 300
winbind offline logon   = yes
winbind refresh tickets = no

wins support    = no
wins server     = 192.168.10.1
wins proxy      = no

dns proxy       = no

# Charset settings
display charset = utf8
unix charset    = utf8
dos charset     = cp866

# Solution for problem with symlinks on *NIX clients
follow symlinks = yes
wide links      = yes
unix extensions = no

# Use extended attributes to store file modes
store dos attributes    = yes

# Use inherited ACLs for directories
nt acl support  = no
inherit acls    = no
map acl inherit = no
case sensitive  = no

#============================ Share Definitions ==============================
[share]
        public  = no
        comment = Shared folder
        browseable      = no
        writable        = yes
        path    = /var/samba/Userdirs/%U
        force user      = "user"
        force create mode       = 0660
        force directory mode    = 0770
```

sysctl.conf

```
kern.coredump=0
kern.sugid_coredump=0
kern.nodump_coredump=1
debug.elf32_legacy_coredump=0
debug.elf64_legacy_coredump=0
debug.minidump=0

kern.ipc.somaxconn=32768
kern.maxfiles=800000
kern.maxfilesperproc=50000
kern.maxvnodes=2000000
```
krb5.conf

```
[logging]
        default = FILE:/var/log/kerberos/krb5libs.log
        kdc     = FILE:/var/log/kerberos/krb5kdc.log
        admin_server    = FILE:/var/log/kerberos/kadmind.log

[libdefaults]
        default_realm   = DOMAIN.LOCAL
        clockskew       = 300

        ticket_lifetime = 85000
        dns_lookup_realm = false
        dns_lookup_kdc  = false
        kdc_req_checksum_type   = 2
        checksum_type   = 2
        ccache_type     = 1
        forwardable     = true
        proxiable       = true

        v4_instance_resolve     = false
        v4_name_convert = {
                host = {
                        rcmd = host
                        ftp = ftp
                }
                plain = {
                        something = something-else
                }
        }
[realms]
        DOMAIN.LOCAL = {
                kdc     = 192.168.10.1:88
                admin_server    = 192.168.10.1:749
                default_domain  = domain.local
        }
[domain_realm]
        .domain.local = DOMAIN.LOCAL
        domain.local = DOMAIN.LOCAL

[pam]
        debug = false
        ticket_lifetime = 36000
        renew_lifetime = 36000
        forwardable = true
        krb4_convert = false

[login]
        krb4_convert = false
        krb4_get_tickets = false
```


----------



## syle (Oct 28, 2011)

*I have same problem*

Upgrading from beta3 to RC1, writing data to ZFS/samba is slow as molassus.
Yet the read speeds seem fine...


----------



## Blackheart (Oct 30, 2011)

I'm also experiencing really slow writes to samba shares since i updated to 9.0RC1 from 8.2, it doesn't matter the file size.


----------



## syle (Oct 31, 2011)

Its really upsetting me as well, perhaps you can join discussion on freebsd-current@freebsd.org mailing list, I've started a thread to try and get some help on this, could use your help, i gonna try samba34 35 and 36 as well as disable IO support see if any differences tonight.


----------



## RusDyr (Nov 7, 2011)

By the way, where or when will be ported samba 3.6? It has been release at this summer and has significant improvement in speed with modern Windows (SMBv2 support).


----------



## thuglife (Nov 7, 2011)

net/samba36?

Compile samba with AIO support, kldload aio and disable sendfile in the smb.conf.


```
socket options = TCP_NODELAY SO_SNDBUF=131072 SO_RCVBUF=131072
use sendfile = no
min receivefile size = 16384
aio read size = 16384
aio write size = 16384
aio write behind = yes
```


----------



## RusDyr (Nov 8, 2011)

Wow...finally it has been released, I missed it


----------



## syle (Nov 8, 2011)

Yeah I have all those options already, still doesn't solve the issue, write speeds are dead slow on beta3. Muxing in a DTS audio file is taking nearly an hour or more, where it was 15 minutes before at best.


----------



## syle (Nov 9, 2011)

I updated to FreeBSD 9-RC2 and it has solved my ZFS samba write problems.


----------

