Samba Performance

I just took the plunge and moved an application from NT to a samba server.
The following are the specifics:
Original server was NT 4.0 sp5 IBM Pent Pro 200 with AHA 2940 and 256mb ram.
My test samba server is AMD 400 with 6 gb IDE. So the ibm server is a real  server and my samba server is really just a workstation.
The application I hosted is GoldMine which is a contact manager that used .dbf files for data and a program written in "C" for the client.
I setup about 6 users. Because of how it works this program opens about 40 files when it starts. It opens all the dbf and index files on startup.

I have noticed a significant slowdown after moving the application. It seems to be most noticeable when starting the program and more noticable when more users are logged in.
The following is my smb.conf file.
Is all of this performance loss explained by less memory and IDE drive?
Are there setting I should change?
What should I do to improve performance in what order?








# Global parameters
[global]
        workgroup = SOFTDESIGNS
        netbios name = SAMBA1
        encrypt passwords = Yes
        map to guest = Bad Password
        guest account = ftp
 
[public]
        path = /home/public
        read only = No
        guest ok = Yes
~
davidpmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jlevieCommented:
Hi David,

How much memory in in the Linux system and what ether card is it using? Is the Linux system's bus running at 66 or 100Mhz?

You can probably improve the performance of Samba a bit by including:

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

in the global section of your smb.conf file.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jlevieCommented:
Oh yeah, you are also being penalized on the Linux system, at least to some degree, by the IDE drive. A high performance SCSI controller and more than one disk would help. I'd probably set it up with the OS on one disk and user/Samba data on at least one other drive. Within reason, the more the system & data gets distributed over multiple spindles the more responsive the system will be.
0
davidpmAuthor Commented:
Whoa!!! That socket options setting made a huge differerence. Are those magic numbers or will I do even better messing with them.
I just check an swat reports about 50 files open per logged in ws. I saw a real difference in starting the program after the socket options setting.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

davidpmAuthor Commented:
Its a 3com nic 3bo something. I tried a new 3Com server NIC but it did not load properly so I went to this one. I tried a d-link and I saw a "something evil" messege on the console.
128 mb ram 100mhz bus. I'm mostly interested in tuning info now since we sell hardware I can build an identical box and run benchmarks NT vs. Samba etc.
I suspect the NT tuning info is a little hard to come by.
I'm expecting that since Samba is running on an OS that is not forced to run a GUI it should squeek ahead.
0
jlevieCommented:
Those are "magic" numbers. I doubt that you'd see much if any improvement by messing with them. What I'd recommend you do is to run top and see what the memory utilization is. I suspect that you might be a bit memory starved with only 128Mb. Memory is relatively cheap for the performance gain it provides if the system has to swap.

I assume you are using a 3c905, correct? A plain old 3c905 (not a "Net management" or "Wake On LAN" version) ought to provide pretty good performance. You could probably get a bit more performance by having two EIDE 7200rpm drives (as Primary & Secondary masters). Put the OS on one & user data on the other so that you have two spindles and head stacks in use.

0
davidpmAuthor Commented:
Adjusted points from 50 to 100
0
davidpmAuthor Commented:
Here it is:
 10:39am  up 20:29,  1 user,  load average: 0.00, 0.00, 0.00
33 processes: 32 sleeping, 1 running, 0 zombie, 0 stopped
CPU states:  0.0% user,  0.5% system,  0.0% nice, 99.4% idle
Mem:   64136K av,  62584K used,   1552K free,  14460K shrd,  27192K buff
Swap: 136512K av,    968K used, 135544K free                 20532K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
 1025 root      13   0  1012 1012   820 R       0  0.5  1.5   0:00 top
    1 root       0   0   380  368   320 S       0  0.0  0.5   0:03 init
    2 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kflushd
    3 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kupdate
    4 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kpiod
    5 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kswapd
    6 root     -20 -20     0    0     0 SW<     0  0.0  0.0   0:00 mdrecoveryd
  286 bin        0   0   308  288   228 S       0  0.0  0.4   0:00 portmap
  339 root       0   0   488  480   388 S       0  0.0  0.7   0:00 syslogd
  350 root       0   0   676  664   312 S       0  0.0  1.0   0:00 klogd
  366 daemon     0   0   312  296   232 S       0  0.0  0.4   0:00 atd
  382 root       0   0   548  540   452 S       0  0.0  0.8   0:00 crond
  402 root       0   0   444  436   368 S       0  0.0  0.6   0:00 inetd
  418 root       0   0   448  436   368 S       0  0.0  0.6   0:00 lpd
  449 root       0   0   400  384   324 S       0  0.0  0.5   0:00 gpm
  466 xfs        0   0   900  892   536 S       0  0.0  1.3   0:00 xfs
  528 root       0   0   384  384   316 S       0  0.0  0.5   0:00 mingetty
  529 root       0   0   384  384   316 S       0  0.0  0.5   0:00 mingetty  

I'm not too good at reading this yet. What do you make of it?
Yes it is a 3c905.
Are you saying that the  3c980b 3Com EtherLink Server card would actually cause problems if I could get it to work. I tried it and Kudsu did not like it.
0
davidpmAuthor Commented:
I just checked the docs and noticed that TCP_NODELAY is the default. Perhaps it would work just as well with just the other two settings.
0
davidpmAuthor Commented:
Also I was reading about starting servers from inetd vs a script. Should I be looking at that also?
0
davidpmAuthor Commented:
I'm trying to puzzle out the top info I posted.
It looks like 64mb memory.
It looks like memory is mostly used but swap is lightly used.

If I added memory would the swap usage go to 0 or is a meg of swap usage the minumum.
0
jlevieCommented:
Top only shows 64Mb of memory with 1.5Mb free. I thought you said this box had 128Mb.

"Mem:   64136K av,  62584K used,   1552K free,  14460K shrd,  27192K buff"

Were the smbd & nmbd daemons running at the time? I'd presume that there probably weren't any Samba users at the time.

For serious use you want Samba running as daemons, not from inetd. The only reason to run it from inetd would be if you needed tcpwrappers for security or if it was only occasionally used on a memory-poor machine. When run as a daemon, the startup time for client connects is reduced over what one would see if it is running from inetd.

The 3c905 cards now exist in several slightly different versions. There's some information about them on http://cesdis.gsfc.nasa.gov/linux/ and at least some of the variants will work. I've also heard good things about the Intel Pro100 boards.
0
davidpmAuthor Commented:
I thought is was 128 now I know it is 64 <g>.
I actually had 4 users logged in at the time. What is your best guess regarding the benifit of adding memory to improve performance.
0
jlevieCommented:
My guess, since you only have 64 MB, would be "considerable". Just about any significant activity will cause swapping, and I think that the kernels dynamic buffers are probably smaller than they'd be with more memory available. Ideally, you like there to be enough memory so that on average the system is running out of memory with a fair bit free, perhaps 5-10Mb as a guess. Since you are playing around with configurations, why not watch the system with top as it gets loaded up. Then add 32-64Mb and see what it looks like then.
0
davidpmAuthor Commented:
Will Do
0
davidpmAuthor Commented:
If you want to comment on some of the other related questions I would appreciate it but your magic numbers did the trick, thanks.
0
jlevieCommented:
Fire away...
0
davidpmAuthor Commented:
If I wanted to pop in another drive for just data what would be the process?

Could you interprete some of the important numbers in my top posting.
How do those numbers compare to other machines you work on. I have very limited experience so do not know what is good, bad, normal etc.

I assume smb is running from a script not inetd, how do I know for sure.

0
davidpmAuthor Commented:
Unfortunatly I may be forced to take this service off Samaba anyway because I can find no way to back up the files. The files are always open because a service is always listening for remote users that may be syncronizing.
0
jlevieCommented:
Let's take the last one first. Which files are you talking about? The Goldmine data? If so, then there is exactly the same problem on NT if there are any clients with the app running when backups occur (I've seen Networker on NT complain about it).

This is something that an "administrative solution" could address. Simply tell everyone that backups will occur at a specific time and that they need to close all apps & log out before then. You should then be able to back up the data as nothing should have a "write lock" on the it. If you want to enforce that policy, simply stop Samba before the backup and restart it when backups are finished.

The default for Samba is to run it from /etc/rc.d/init.d/smb. You can tell for sure by looking in /etc/inetd.conf for lines that would start smbd & nmbd.

Lets consider a few of the lines that top shows. The line:
CPU states:  0.0% user,  0.5% system,  0.0% nice, 99.4% idle
should be pretty self-explanatory, if you know that "user" refers time the cpu spends executing "user level code", "system" refers to cpu time spent in "system state" (file I/O, kernel, networking, etc), and "nice" is time spent running tasks at other than normal priority (see man nice).

This line:
Mem:   64136K av,  62584K used,   1552K free,  14460K shrd,  27192K buff
says what the total memory is (av), how much is current in use or free (used/free), how much is in shared use (shrd) for dynamic libs or interprocess shared memory, and finally how much is being used for various buffers (kernel buffers, file/disk buffers, network buffers, etc). Although shown on the line with the swap data, "cached" refers to the amount of memory used for filesystem cache's (see man free for more info).

Speaking of memory, some MB's don't report the installed memory in a way that Linux can directly use and you may see 16, 32, 64, 128Mb when you've got more than one of those amounts installed. It's easy to fix. When booting the system, type "linux mem=nnn" (nnn=installed memory) and see if all is recognized. Assuming it is, add 'append="mem=nnn"' to the global section of /etc/lilo.conf (and run lilo to install).

There's not much that can be inferred from an idle system (except that in this case it's memory starved and total & used are almost equal). Looking at top output as the system loads up will give you some ideas as to what resources are being consumed. It won't necessarily tell you where a bottleneck is (for example, very high disk I/O won't directly show, but the "system" percentage of cpu will be high relative to the others).

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.