Memory usage in Samba 2.0.7

Scott Lawson s.lawson at
Mon Oct 9 17:03:29 GMT 2000

Here is a copy of what I sent to Lucy off list. If you want to use hostnames use
a %h instead of a %g


Seperating the smb.conf file is easy. All you need is one line. Create a master
smb.conf file that contains the global section and maybe the homes section. In
global section put in a line that reads like this :

include = /usr/local/samba/lib/includes/%u.smb.conf

This is for user specific smb.conf


include = /usr/local/samba/lib/includes/%g.smb.conf

This is for primary group specific smb.conf

Obviously the path to these files can be anything, but I would suggest you keep
them in a sub-directory called includes. (keeps things nice n neat!)

In these files place all your shares, simple eh?
This will very likely reduce your memory footprint a bit and increase speed

Good Luck!


"Vetter, Gary H." wrote:

> Could you provide any details on how you customised/automated the smb.conf
> file, please? I'm not familiar with amd maps.
> Thanks.
> Gary Vetter
> ND Retirement and Investment Office
> -----Original Message-----
> From: Peter Polkinghorne [mailto:Peter.Polkinghorne at]
> Sent: Monday, October 09, 2000 10:53 AM
> To: samba at; Guo Lucy-GLG005
> Cc: Peter.Polkinghorne at; Scott Lawson
> Subject: Re: Memory usage in Samba 2.0.7
> Back when we started with Samba (1.9.18p10) we had a smb.conf file
> with all our possible shares on every host (thanks to the wonders of
> AMD and NFS this worked).  However it was inefficient for the SMB then
> NFS hops, and the large smb.conf - 350 shares.
> Basicly Samba is relatively inefficient at allocating memory for
> shares and this is done for each connection.
> Our solution was to customise (by automation using amd maps) the smb.conf
> per host to minimise the number of hsres.  This was a big win.
> [sorry for belated reply - a bit behind in reading ...]
> Scott Lawson said:
> > Lucy,
> > That's a big smb.conf file! I wonder if that might be the issue. It
> > would be interesting to find out if there are any other people with
> > files of that size...
> >
> > May I ask why you have 1000 shares in one file? I assume that they
> > aren't home
> > directories but actual seperate shares. (Homes can be addressed with
> > just one share entry for thousands of users) I imagine that each copy
> > of the smbd daemon keeps a copy of the smb.conf in memory, so I would
> > expect that your daemons might be a bit larger than normal. I believe
> > that the each daemon has the samba configuration stored in memory and
> > that it refreshes that every few minutes, with  a lot of daemons
> > running that could account for a large a mount of memory. How samba
> > actual stores the configuration in memory could have something to do
> > with the daemon size that you are experiencing. One thing you could
> > try if you have a spare box to use, copy your binary installation
> > across to another similiar system and cut the smb.conf right down to
> > just the base configuration and a couple of shares. Then have a look
> > at the memory footprint of the daemons, is it still the same?
> > Scott.
> --
> ----------------------------------------------------------------------------
> -
> | Peter Polkinghorne, Computer Centre, Brunel University, Uxbridge, UB8
> 3PH,|
> | Peter.Polkinghorne at   +44 1895 274000 x2561       UK
> |
> ----------------------------------------------------------------------------
> -



Scott Lawson
Systems Manager
Department Of Information Services
St. George's Hospital Medical School
London SW17 0RE

P: 44 (0)208 725 2896
F: 44 (0)208 725 3583

mailto:s.lawson at

Quote of the week :

"The difference between 'involvement' and 'commitment' is like a
bacon-and-eggs breakfast: the chicken was 'involved' - the pig was


More information about the samba mailing list