Samba Configuration file and memory usage

Peter Polkinghorne Peter.Polkinghorne at brunel.ac.uk
Mon Dec 14 11:18:37 GMT 1998


[I originally posted this to the samba mailing list - but Harry Ford suggested 
this list was more appropriate]

Background:
 Samba 1.9.18p10 on Solaris 2.5.1 built with Sun C 4.2.

Problem:
 Observed that samba daemons (smbd) were using 2Mb of space each - a problem 
on our older servers with 100+ clients.

This was also more than when we did some performance testing.

Observation:
 On an unused server ran truss (system call tracer) on main daemon (do not use 
inetd) and also followed children.  From brk.2 calls, it was clear that 1.2Mb 
of data was added between opening & closing the config file.

Our config file is large - 778 defined shares - 128k bytes in size - all 
possible shares for all possible servers - NFS & AMD means that will work 
(sub-optimally) for which ever server you attach to.  The mounting program on 
the PCs (home grown) should ensure optimal servers chosen.

By looking at free swap space as another measure - just over 2Mb of free swap 
space went for each daemon started (from none).

Next experiment was to cut down to just Global and Homes sections.  Then first 
daemon (ie master) used 400k and subsequent used 750k. (Factor of 3-5 
improvement).

Code Inspection:
 Looking at params.c and loadparm.c indicates lots of calls to Realloc() 
(which in turn calls realloc).  Could this cause gross memory inefficiency for 
large configuration files (in size & shares)?

Our Solution:
 The original configuration files were uniform for ease of change deployment 
(over 70 servers) and for dealling with PCs that did not use our mount program 
or if the mount program did not work.

However 200 shares are specific to one host and another 400 are auto-generated 
and can be made host specific and will be made so.

Question:
 Is 2.0 more memory efficient with config files?


-- 
-----------------------------------------------------------------------------
| Peter Polkinghorne, Computer Centre, Brunel University, Uxbridge, UB8 3PH,|
| Peter.Polkinghorne at brunel.ac.uk   +44 1895 274000 x2561       UK          |
-----------------------------------------------------------------------------




More information about the samba-technical mailing list