Weird Samba slowness problem

Missing Ghost

Senior member
Oct 31, 2005
254
0
76
Hello, I'm having some problems with a samba server.
Here is what I have: a samba server (3.2.5) running on debian lenny with windows vista clients.

The problem is that, while the server speed is quite fast (in MB/s), it sometimes has unusual latencies before the data transfers can start, something like 20-60 seconds.

I have been trying a lot of stuff to try to identify the source of the problem and I've narrowed it to something very specific: this latency only happens when the file being accessed is owned by a different user. To explain more, I'll give an example:

Say there are two users: user1 user2
both are in a group: group1

if user1 tries to access a file, it will be slow with files like this: (ls -lh output)
Code:
-rw-rw---- 1 user2 group1 93K 2009-11-07 01:32 somefile
-rw-rw---- 1 root group1 93K 2009-11-07 01:32 somefile

but it will be extremely fast with a file like this:
Code:
-rw-rw---- 1 user1 group1 93K 2009-11-07 01:32 somefile

this is absolutely reproducible: if I change the file ownership with chown it will be fast, and if I revert it it will be slow again.

this server has been in use since about 2 years and I *think* the problem started when I upgraded its hard drives.

Any help will be greatly appreciated, as I've searched with no success for a long time.
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Hello, I'm having some problems with a samba server.
Here is what I have: a samba server (3.2.5) running on debian lenny with windows vista clients.

The problem is that, while the server speed is quite fast (in MB/s), it sometimes has unusual latencies before the data transfers can start, something like 20-60 seconds.

I have been trying a lot of stuff to try to identify the source of the problem and I've narrowed it to something very specific: this latency only happens when the file being accessed is owned by a different user. To explain more, I'll give an example:

Say there are two users: user1 user2
both are in a group: group1

if user1 tries to access a file, it will be slow with files like this: (ls -lh output)
Code:
-rw-rw---- 1 user2 group1 93K 2009-11-07 01:32 somefile
-rw-rw---- 1 root group1 93K 2009-11-07 01:32 somefile
but it will be extremely fast with a file like this:
Code:
-rw-rw---- 1 user1 group1 93K 2009-11-07 01:32 somefile
this is absolutely reproducible: if I change the file ownership with chown it will be fast, and if I revert it it will be slow again.

this server has been in use since about 2 years and I *think* the problem started when I upgraded its hard drives.

Any help will be greatly appreciated, as I've searched with no success for a long time.

Can we get more information about how users are set up on your box? Are user1 and user2 Windows users or UNIX users? From your post it sounds like they're UNIX users.

Are you saying the problem is local only? That is, you have a directory shared via Samba, but the local users on the UNIX side see latency when trying to list files in the directory? Where is Samba coming into play here I guess is my question.

Furthermore, as far as your users are configured, are you using LDAP or any other equivalent services for users? NIS? If so, can we see a dump of your nsswitch.conf file?
 

Missing Ghost

Senior member
Oct 31, 2005
254
0
76
Can we get more information about how users are set up on your box? Are user1 and user2 Windows users or UNIX users? From your post it sounds like they're UNIX users.

Are you saying the problem is local only? That is, you have a directory shared via Samba, but the local users on the UNIX side see latency when trying to list files in the directory? Where is Samba coming into play here I guess is my question.

Furthermore, as far as your users are configured, are you using LDAP or any other equivalent services for users? NIS? If so, can we see a dump of your nsswitch.conf file?
The users I'm talking about are UNIX users. Nobody is using the computer directly, it's just a headless samba server for the windows clients.
I have setup the windows computers with the same user names and passwords so that they can access the samba server. Everything has worked fine for about 2 years.
I don't use LDAP. I have added each user and group manually on the samba server.
Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
It sounds like based on the info given that you might be hitting a user lookup timeout.. can you try appending files before compat for passwd,shadow,group in nsswitch.conf and see if that helps?

Furthermore, can we see a dump of your smb.conf?
 
Last edited:

Missing Ghost

Senior member
Oct 31, 2005
254
0
76
It sounds like based on the info given that you might be hitting a user lookup timeout.. can you try appending files before compat for passwd,shadow,group in nsswitch.conf and see if that helps?

Furthermore, can we see a dump of your smb.conf?
I tried this, but it's still quite slow.

Here's my smb.conf
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Does this happen for every share in your smb.conf or only particular ones?

What happens if you change your create mode to something like 770?
Comment out the force group parameter and see if it helps?

With something like this, it's most likely an option you're setting that is causing some sort of lookup and then eventual timeout within the system.

Nothing else has changed? Did you upgrade Samba at all? You mentioned you changed hard drives but nothing else?

Do you see anything interesting in smbd.log ?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |