Solved

Samba Performance

Posted on 2000-04-16
19
476 Views
Last Modified: 2012-05-04
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
~
0
Comment
Question by:davidpm
  • 12
  • 7
19 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2721249
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2721255
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
 

Author Comment

by:davidpm
ID: 2721455
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
 

Author Comment

by:davidpm
ID: 2721462
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2721581
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
 

Author Comment

by:davidpm
ID: 2722903
Adjusted points from 50 to 100
0
 

Author Comment

by:davidpm
ID: 2722904
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
 

Author Comment

by:davidpm
ID: 2722928
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
 

Author Comment

by:davidpm
ID: 2723380
Also I was reading about starting servers from inetd vs a script. Should I be looking at that also?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:davidpm
ID: 2723834
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2724051
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
 

Author Comment

by:davidpm
ID: 2724204
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2725098
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
 

Author Comment

by:davidpm
ID: 2726983
Will Do
0
 

Author Comment

by:davidpm
ID: 2729400
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2730688
Fire away...
0
 

Author Comment

by:davidpm
ID: 2730779
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
 

Author Comment

by:davidpm
ID: 2731551
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
 
LVL 40

Expert Comment

by:jlevie
ID: 2731840
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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now