[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Samba config / performance

Posted on 2006-05-22
Medium Priority
Last Modified: 2008-03-06
Simple question. I want to know how I can specify the number of child processes samba spawns when it starts up? It seems to default to two and I wish to have more.

Here's why, for I might be pursuing the wrong solution here. I do a lot of work with this samba server, from multiple PCs. It seems to take forever when it initially connects and I think having more available would help this. I am assuming samba takes all connections from PC A under whatever process it initially connects to, which is why I suspect I may be wrong in my search. Most of my data is on the samba server, and when I finish some work, I move it to another share. This seems to drag everything else down because its a lot of data being copied and I can't seem to do much else when doing this. I have seen multiple child processes owned by the same user though which makes me suspect I can configure this to distribute the load over multiple. I have about 7 mapped drives to it and work from all constantly.

Any ideas? I hope that is enough information to go on. This really only started when I upgraded it from Fedora core 4 to 5 as well.

[root@persephone ewebster]# rpm -qa | grep samba
[root@persephone ewebster]# ps aufx | grep smb | grep -v grep
root      2010  0.0  0.1  12472  2224 ?        Ss   12:43   0:00 smbd -D
root      2013  0.0  0.0  12472  1000 ?        S    12:43   0:00  \_ smbd -D
ewebster  2224  0.2  0.2  13572  4188 ?        S    12:43   1:06  \_ smbd -D
root      2732  0.0  0.1  12904  3192 ?        S    14:33   0:00  \_ smbd -D
xbmc      4633  0.6  0.1  12904  2772 ?        S    21:35   0:00  \_ smbd -D
[root@persephone ewebster]#

Other devices do also use this server at the same time but not nearly as heavily as I do. And I am sure the hardware can handle what I'm doing. It has for some time now.
Question by:sophomERIC
  • 3
  • 2
LVL 26

Accepted Solution

jar3817 earned 500 total points
ID: 16739283
"It seems to take forever when it initially connects..."
Sounds like a name resolution problem. Are you accessing this thing by ip address or some kind of name? (\\\share or \\servername\share or \\servername.fulldomain.com\share) If by name, is this name registered in DNS and WINS? Is the server on the same subnet as the clients?

I don't think having having more processes will make the initial connection faster, it is probably not configured correctly. Can you reply with your smb.conf file? What are the specs of the machine?

I think the performance when moving data between shares might be a result of the speed of your disk in the server and the network throughput. When you move data between shares, is it moving to different disks or just a different directory on the same disk? What kind of disks are we talking about (ata,sata,scsi), what about bus speed? What speed is the network connection to the server? What is the bandwidth utilization like on the server?

I have a samba 3 server running on a 1GHz machine with 512MB at my school where shares are mapped on at least 200 different computers everyday all day. Students use the for shared storage to keep their work and really abuse it. It starts with the default of 2 processes and takes maybe 0.5 secs to map a drive or to bring up a share with \\name.domain.com\share. Sure it slows down when everyone starts hammering it mostly because it's using a 7200rpm parallel ATA disk. And has to struggle to keep up with all the read/writes.

Author Comment

ID: 16739704
I have it mapped using the host name, but my workstation is in the hosts file of the server. I didn't even think to try by IP. I will remap them and see what happens. These are all on the same subnet.

[root@persephone ~]# cat /proc/cpuinfo
vendor_id       : AuthenticAMD
model name      : AMD Athlon(tm) XP 2500+
cpu MHz         : 1833.556
cache size      : 512 KB
[root@persephone ~]# cat /proc/meminfo
MemTotal:      2076272 kB

The actual discs that this data is on is cluster of 4 Western Digital 250 GB sata drives in a raid 5 array on a 3ware Escalade 9000 raid controller. The hard should be able to handle it. Network does seem to be the likely culprit. This isn't a proper network anyways, just a workgroup config so there is no domain or local dns server, just a caching one.

[root@persephone samba]# cat smb.conf | grep -v \# | grep -v \;

        Workgroup = Workgroup
        netbios name = Persephone
        smb ports = 139

        time server = yes
        wins support = yes

        server string = Fedora Core 5
        hosts allow = 192.168.50. 10.10.6.

    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes

       guest account = guest
        log file = /var/log/samba/%m.log

        max log size = 2000
        encrypt passwords = yes
        smb passwd file = /etc/samba/smbpasswd

        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

        remote browse sync =
        remote announce =

        local master = yes
        os level = 38
        domain master = yes
        preferred master = yes
        dns proxy = no

   invalid users = root
   status = yes
        idmap uid = 16777216-33554431
        idmap gid = 16777216-33554431
        template shell = /bin/false
        winbind use default domain = no
        username map = /etc/samba/smbusers
        guest ok = yes

Socket options is my best guess at what to try config wise, but I don't really know what else to try in place of it.
LVL 26

Expert Comment

ID: 16741259
Looks like Samba is setup as a wins server...does each workstation have this ip set as the wins server?

"I have it mapped using the host name, but my workstation is in the hosts file of the server..."

Since this is a workgroup with no authoritative dns you might want to make sure the server's name (persephone) is in the CLIENT'S hosts files, since the client will be initiating the communication with the server. On XP the hosts file is located at c:\WINDOWS\system32\drivers\etc\hosts and has the same syntax as the linux vesion. Since the computers are probably trying to resolve the name in DNS first and timing out (since it is only a resolver for internet names), putting that name in the hosts file should speed up the initial connection.

Author Comment

ID: 16748610
It does appear to have just been that it was mapped by host name instead of IP. I forgot it used to be in the hosts file, but this workstation was recently reimaged with a different image than the last. It was supposed to be a similar image but apparantly I overlooked the hosts file on this one. Thanks for you help.

I would still be curious as to how to specify the number of smb child processes if you happen to know, simply out of curiousity.
LVL 26

Expert Comment

ID: 16750236
Glad it's working better for you now.

I looked through the man page for smb.conf and the only thing related to the number of processes is the "max smbd processes" directive, which is set to unlimited by default. I don't think there is a way of specifying more than 2 processes at startup. Smbd will start more as it needs them, so I don't think it's something you should worry about either.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question