Samba Server Memory Requirements

David Collier-Brown davecb at Canada.Sun.COM
Fri Feb 27 12:54:27 GMT 1998


on Tue, 24 Feb 1998 08:05:05 -0600  Gerald W. Carter wrote:
[speaking about Solaris]
> There is one smbd process per user connected ( not per share ).  Total
> size is ~2Mb total including swap ( ~1Mb working set ).

You replied:
| That much?
| I use samba on a Linux box (486-100, 20MB RAM, serving up to 20 
| DOS/Win311/Win95 boxes). I've measured the memory consumption of 
| Samba running 'netstat | grep -c netbios-ssn' and 'free' once per 
| minute as a cron job.
| On my box, Samba only needs 350..400K per smbd.
|
| There are tree explanations for the difference:
| 1. Linux makes smaller programs than Sparc stations.
|   (I don't believe it, not 1:4).
[snip]

	You're seeing a semi-famous change in the way Solaris
	reports memory usage.  There is an article about it at
	http://www.sun.com/sunworldonline/swol-10-1995/swol-10-perf.html
	entitled ``Help! I've lost my memory!''...

	In short, Solaris measures memory use very differently
	than you would expect from BSD-based OSs.  I'll steal
	a quote from Adrian's FAQ:	

A: Look at my SunWorld column entitled "Help! I've lost my memory!" Then 
it may become clear why your calculation does not work. The VM system is
far
more complex than your simple equation presumes. I don't think the
available
data is sufficient to model memory use. In particular,the only data
available on a per-process basis is the size of the address space for
the
process, and the amount that has valid memory mappings. These values can
be
seen (measured in kilobytes) via the old-style ps command, in the SZ
(process size) and RSS (process resident set size) fields: 

% /usr/ucb/ps uax
USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
root      2026  3.0  2.1 1424 1284 pts/6    O 23:14:29  0:01 /usr/ucb/ps
uax
adrianc   2021  0.7  4.1 3444 2500 ??       S 23:14:26  0:00
/usr/openwin/bin/c
adrianc   1785  0.6 11.110048 6840 console  S 20:50:55  1:12
/usr/openwin/bin/X
adrianc   2024  0.3  1.4  980  856 pts/6    S 23:14:27  0:00 /bin/csh
...

Unfortunately for your calculation, the RSS excludes pages that are in
memory but do not have valid mappings, and it includes pages that are
shared
by other processes. Your calculation also doesn't consider the memory
used
by files that are cached. To obtain this data, kernel code would have to
be
written that traverses many data structures and tallies the pages. This
is
not available in the base release, or in any commercial performance
tools
that I am aware of. 

I think it would be useful to have more information about memory usage,
and
it is on my list of things I'd like to see added to Solaris. 

	I haven't heard anything else since... 
	

--dave
--
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | davecb at hobbes.ss.org, canada.sun.com
M2N 1Y3. 416-223-8968 | http://java.science.yorku.ca/~davecb


More information about the samba mailing list