LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Samba slow performances (http://www.linuxquestions.org/questions/slackware-14/samba-slow-performances-4175464676/)

sphawk 06-04-2013 09:21 AM

Samba slow performances
 
hi all :hattip:

My own server is a Slackware 13.0 and work properly, but i've another server with some serious problems with samba speedrate.
The problem affect only samba, not FTP.
Online i've found many tricks to improve speed but I can't solve the problem.
This is the first time that samba give me some problems.


My Server
Code:

# uname -a
Linux Server 3.2.44-grsec

# cat /etc/slackware-version
Slackware 13.0.0.0.0

# lspci |grep -i ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
01:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

# hdparm -t /dev/sdb1
/dev/sdb1:
Timing buffered disk reads:  396 MB in  3.01 seconds = 131.50 MB/sec

# mount | grep samba
/dev/sdb1 on /home/samba type ext3 (rw,nosuid,nodev)

# smbd --version
Version 3.2.15

Download rate: 11.2 MB/s
Upload rate: 9.3 MB/s




Other Server
Code:

# uname -a
Linux Server 3.2.44-grsec

# cat /etc/slackware-version
Slackware 14.0

# lspci |grep -i ethernet
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
03:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

# hdparm -t /dev/sdb1
/dev/sdb1:
Timing buffered disk reads: 378 MB in  3.01 seconds = 125.57 MB/sec

# mount | grep samba
/dev/sdb1 on /home/samba type ext4 (rw,nosuid,nodev)

# smbd --version
Version 3.6.8

Download rate: 380 KB/s
Upload rate:  103 KB/s




File smb.conf
Code:

[global]
workgroup = WORKGROUP
netbios name = MyOwn
server string = MyOwn
hostname lookups = no
guest account = samba
log file = /var/log/samba/samba.%m
log level = 2
max log size = 2000
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=16384 SO_SNDBUF=16384
interfaces = 172.16.0.0/24 127.0.0.1/32
bind interfaces only = yes
username map = /etc/samba/usermap
dns proxy = No
map to guest = Bad User
printcap name = /dev/null
load printers = no
printing = bsd
local master = yes
preferred master = yes
domain master = yes
os level = 65
announce as = NT
wins support = yes
name resolve order = wins hosts lmhosts bcast
null passwords = true
veto files = /lost+found/ /.recycle/

[public]
comment = public share
hosts allow = 172.16.0.0/24
hosts deny = 0.0.0.0/0
path = /home/samba/public
read only = no
guest ok = yes
create mask = 0640
directory mask = 0750
force user = samba
force group = smbusers


The config is the same except for interfaces and host allow: my server use 172.16. network, other server 192.168.
Tnx a lot for any help :(

kikinovak 06-04-2013 09:45 AM

My first suggestion would be to check your DNS configuration on the slow server. What do 'hostname' and 'hostname --fqdn' return? Is the server pingable both by IP address and hostname from client machines? As far as I remember, past Samba problems were often due to DNS issues.

gezley 06-04-2013 10:01 AM

Have you assigned the Wins server address to the Samba clients (statically or by DHCP)? If not then it's possible Samba is using broadcasts to advertise itself to the clients. If the switch on the second network is just a 10/100MB switch then you will get much poorer speeds than you would get on your home network with a 1Gb switch and just one or two clients.

The first thing to do is check the speed of the switch or router connecting your devices on the second network, and the second thing to do is to make sure the clients are configured with the Wins server address. If your DHCP server on the second network does not provide this option then you will have to either change your DHCP server or else assign the Wins server address manually on all clients.

sphawk 06-04-2013 10:17 AM

Quote:

Originally Posted by kikinovak (Post 4965189)
What do 'hostname' and 'hostname --fqdn' return?

mmmmh

Code:

# time hostname
server

real    0m0.001s

# time hostname --fqdn
server

real    0m10.013s

really slow!
fixed editing /etc/hosts file

Code:

127.0.0.1      server server.domain.pri localhost
::1            server server.domain.pri localhost

but samba is still slow

Quote:

Originally Posted by kikinovak (Post 4965189)
Is the server pingable both by IP address and hostname from client machines? As far as I remember, past Samba problems were often due to DNS issues.

hostname is not pingable and the resolution is wrong.
i'm trying to fix it.
tnx!

sphawk 06-04-2013 10:22 AM

Quote:

Have you assigned the Wins server address to the Samba clients (statically or by DHCP)?
yes, DHCP

Code:

option netbios-name-servers 192.168.0.1;
Quote:

The first thing to do is check the speed of the switch or router connecting your devices on the second network, and the second thing to do is to make sure the clients are configured with the Wins server address. If your DHCP server on the second network does not provide this option then you will have to either change your DHCP server or else assign the Wins server address manually on all clients.
ok, i'll check.
tnx a lot!

gezley 06-04-2013 10:42 AM

Quote:

Originally Posted by sphawk (Post 4965169)
interfaces = 172.16.0.0/24 127.0.0.1/32

Shouldn't this be something like the following:

Code:

interfaces = 172.16.0.100/24
or just this:

Code:

interfaces = eth0
?

Does Samba need to listen on localhost (lo0)?

kikinovak 06-04-2013 10:57 AM

Here's what this looks like in my local network, on the server:

Code:

[root@nestor:~] # hostname
nestor
[root@nestor:~] # hostname --fqdn
nestor.microlinux.montpezat
[root@nestor:~] # smbclient -L localhost -N
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.8]

        Sharename      Type      Comment
        ---------      ----      -------
        Public          Disk      Partage Public
        Confidentiel    Disk      Partage Confidentiel
        IPC$            IPC      IPC Service (Serveur de fichiers et d'impression NESTOR)
        Brother_HL-2030_series Printer  Brother HL-2030 series
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.8]

        Server              Comment
        ---------            -------
        NESTOR              Serveur de fichiers et d'impression NESTOR

        Workgroup            Master
        ---------            -------
        WORKGROUP            NESTOR
[root@nestor:~] # cat /etc/hosts
# /etc/hosts
127.0.0.1                localhost.localdomain localhost
192.168.2.1                nestor.microlinux.montpezat nestor


sphawk 06-04-2013 11:37 AM

Quote:

Originally Posted by gezley (Post 4965227)
Does Samba need to listen on localhost (lo0)?

lo is for test
i prefer to use interface in case i must change network config, but substantially is the same.

gezley 06-04-2013 11:45 AM

Quote:

Originally Posted by sphawk (Post 4965255)
i prefer to use interface in case i must change network config, but substantially is the same.

I still think that for the interfaces parameter you should specify the interface address, and not the network range it falls into, otherwise you are saturating the network with unnecessary broadcasts.

For example, 172.16.0.100, not 172.16.0.0.

gezley 06-04-2013 11:47 AM

Quote:

Originally Posted by sphawk (Post 4965208)
mmmmh

Code:

# time hostname
server

real    0m0.001s

# time hostname --fqdn
server

real    0m10.013s

really slow!
fixed editing /etc/hosts file

Code:

127.0.0.1      server server.domain.pri localhost
::1            server server.domain.pri localhost

but samba is still slow

Did you restart Samba after making these changes?

sphawk 06-04-2013 12:06 PM

Quote:

Originally Posted by gezley (Post 4965262)
For example, 172.16.0.100, not 172.16.0.0.

u'r right, my error
fixed

Quote:

Originally Posted by gezley (Post 4965263)
Did you restart Samba after making these changes?

yes
to prevent all problem, i've installed bind and configured to forward the queries to the router (192.168.1.1).
restarted client and server
now all client use the server as dns (192.168.0.1) and can resolve .pri hosts

samba is still slow like a dead snail
i back to search for possible solutions :study:
tnx all for help


All times are GMT -5. The time now is 10:06 PM.