After installing Samba 2.0.7, we found each connection takes more than 10MB memory. Is this normal? Thanks. -Lucy
Lucy, What OS are you using? Did you compile it yourself? What compiler did you use? I tend to have all Smbd daemons taking 4.5 Mb of memory each. This consistant across all my Samba servers (about 10). I am running Solaris 7 and Samba 2.07 compile with gcc 2.95. More than 5 Mb would be considered abnormal on a Solaris system, I am not sure about any others. However I wouldn't expect it to differ by very much over Solaris. Scott. Message: 3 From: Guo Lucy-GLG005 <Lucy.Guo@motorola.com> To: "'samba@samba.org'" <samba@samba.org> Subject: Memory usage in Samba 2.0.7 Date: Wed, 27 Sep 2000 15:44:18 -0500 charset="iso-8859-1" After installing Samba 2.0.7, we found each connection takes more than 10MB memory. Is this normal? Thanks. -Lucy -- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
Andy, Not a problem contacting me directly. I am assuming that the users are loggiong into win98 with the appropriate username/password combination as you have in unix. These need to be the same or samba will request a password from you if they differ. I also assume you are using security=user First off the users that are to be valid users need to have a unix account on the system, or are being translated to an account. The account needs to have the appropriate priveledges on the directory you wish to share, or belong to a a group that has the appropriate rights to the directory. (That is what I use). I tend to create groups for each share that is not specific to a user and then force ownership of the share to that group. I then grant rwx to that specific group on that subdirectory. I then use a force group in samba to force the write of the share to that group. This keeps the share specific ownerships nice and neat, also good if you have people accessing directly the share from unix too. Anyway here is a typical share of mine so you can see how I set them up for specific groups of people. [share] comment = Writable Cardiology share path = /exprt/home/share valid users = user1,user2,user3 force group = special read only = No force create mode = 0770 directory mask = 0770 force directory mode = 0770 browseable = No You can also set the GID bit on the directory as well if you want instead of the force group, samba will work either way. I hope this helps, let me know if you need more info. Be as specific as you can, also an smb.conf file is VERY useful to help me understand exactly what you are doing. Hope this helps, if you need anything more just drop me a line. Scott. Andy Clay wrote:> Hi Scott, I hope you don't mind me addressing you directly but it > appears you have a pretty strong working knoledge of samba and I have > a very simple question that I've never been able to get answered. > > I have samba running on AIX. The only bump I have is I cant figure > out the relationship of Samba passwords and the use of the valid user > setting. > > I'm trying to make it so that on a given directory only the users I > have set as "valid users" are allowed access but those users should > not have to enter a password to gain access to the folder/directory > from their windows 98 Pc's > > I've purchase several samba book and I just cant find the answer to this. > > If you have time to shed some light on this I would really appreciate it. > > Thanks > Andy Clay > MIS Director > IDG of New Englad > -- > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > My email address has changed to andyclay@galaxyinternet.net Please > update your address book.-- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
Andy, OK, I understand a bit more. I think I know how to solve your problem, there is a parameter called "username map" this allows you to point to a file so that when it recieves a request from "slawson" from a windows machine it will try that username and then it will check the username map to see if there is an alternative name mapped to the same name. That should do the trick for you nicely. You will still have to have the same pasword on the unix system as you have on the NT server but that will allow you to have two different usernames on two different systems, as long as the passwords are the same. If you want to synchronise between the two you should maybe look into a meta-directory product. By the way, you mentioned you had bought some books, if it is "Sams, teach yourself samba in 24 hours" the info about username map is on page 95. Scott. Andy Clay wrote:> Hi Scott, > > First off thanks a million for take the time to answer me.. I really > appreciate it. > > I think your first paragraph answers a lot of my question. The id > that a user enters when their PC first starts up is the id to allow > the network servers for email (outlook exchange) to identify them. > The AIX side of things are systems for our legacy business systems. > The aix id a user has is always different then the id they use to > sign onto the network (windows id). So that explains why when they go > to open a folder that their aix user id as been attached to (valid > user) they cant get access. > > I was hopeing that the user file where you connect a aix user id to > windows id would be used by the system to bridge between the 2 worlds. > > Example: > ------------------- > smb.conf > > [andy_clay] > path = /refco/samba/andy_clay > public = no > writable = yes > valid users = claya aclay > > ------------------ > users file > > aclay = claya ANDYS_MAC > ------------------ > > You know anyway to make samba look at the user file and know that > when the user "claya" signs on to windows its also aix user "aclay" > so that it doesn't have to ask for a password when that user trys to > open the "andy_clay" folder which has a valid user of "aclay"? > -- > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > My email address has changed to andyclay@galaxyinternet.net Please > update your address book.-- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
Lucy, I have run samba 2.07 on Solaris 2.6 with exactly the same perfromance characteristics as on Solaris 7. The version of gcc you used to compile it may be the source of your problems. I believe there were quite a few problems in the memory optimisation routines in some of the older versions of gcc. (don't quote me on that....). I would reccommed that you consider recompiling with the latest version of gcc which is 2.95.2. A package of this is readily available at http://www.sunfreeware.com Hopefully this will fix your problem. Otherwise is there anything different about your Solaris installation on this sytem? Also you state that your smb.conf is big, how big is big? I have about 50 shares from mine, the smb file is about 25 Kb in size so it's not small. I have not noticed any performance degredation at all. Scott. Guo Lucy-GLG005 wrote:> Scott, > We are using Solaris 6 and gcc 2.7x compiler. Would you think the version of > gcc will make difference? > I also noticed the other system is doing OK (4.5 MB for each smbd daemon), > the only difference is ours have much bigger smb.conf file. (We made a lot > of things available for mapping to users' PCs, but it only took less than 3 > MB per connection on Samba 2.0.5.) > Thank you for your time, Scott. > Lucy > > -----Original Message----- > From: Scott Lawson [mailto:s.lawson@sghms.ac.uk] > Sent: Thursday, September 28, 2000 6:29 AM > To: Lucy.Guo > Cc: samba@samba.org > Subject: RE: Memory usage in Samba 2.0.7 > > Lucy, > > What OS are you using? Did you compile it yourself? What compiler did > you > use? > > I tend to have all Smbd daemons taking 4.5 Mb of memory each. This > consistant across > all my Samba servers (about 10). I am running Solaris 7 and Samba 2.07 > compile with > gcc 2.95. > > More than 5 Mb would be considered abnormal on a Solaris system, I am > not sure about > any others. However I wouldn't expect it to differ by very much over > Solaris. > > Scott. > > Message: 3 > From: Guo Lucy-GLG005 <Lucy.Guo@motorola.com> > To: "'samba@samba.org'" <samba@samba.org> > Subject: Memory usage in Samba 2.0.7 > Date: Wed, 27 Sep 2000 15:44:18 -0500 > charset="iso-8859-1" > > After installing Samba 2.0.7, we found each connection takes more than > 10MB > memory. Is this normal? Thanks. > -Lucy > > -- > > __________________________________________________________________ > > Scott Lawson > Systems Manager > Department Of Information Services > St. George's Hospital Medical School > Tooting > London SW17 0RE > UK > > P: 44 (0)208 725 2896 > F: 44 (0)208 725 3583 > > mailto:s.lawson@sghms.ac.uk > > http://www.sghms.ac.uk > > Quote of the week : > > "The difference between 'involvement' and 'commitment' is like a > bacon-and-eggs breakfast: the chicken was 'involved' - the pig was > 'committed'." > > __________________________________________________________________-- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
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. Guo Lucy-GLG005 wrote:> Scott, > > There is nothing different besides the smb.conf file. We have over 1000 > shares and the smb.conf file is about 740K. Each entry/share has about 10 > lines, a lot of them have the same information such as "available = yes", > "browseable = yes", etc. I wonder if I can consolidate them somehow to > reduce the size of smb.conf file. > I will try to re-compile Samba 2.0.7 with newer version of gcc and let you > know the result. > Have a good weekend! > -Lucy-- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
Lucy, 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 the 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 or 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 considerably. Good Luck! Scott. Guo Lucy-GLG005 wrote:> Steve, > > I'm still waiting for network connection to do further testing... > The reason we have that big size of smb.conf file is we are serving > thousands of users and each user/group has its own files/directories to > share (in addition to their home directories). No one actually need all of > those 1000 shares, the average is about 3-5 shares per person. > > I'm looking for a way to separate the smb.conf file so that different user > will be directed to different smb.conf file. Would you have any idea to make > it work? Any suggestions will be greatly appreciated. > > -Lucy-- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________
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@brunel.ac.uk +44 1895 274000 x2561 UK | -----------------------------------------------------------------------------
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@brunel.ac.uk] Sent: Monday, October 09, 2000 10:53 AM To: samba@us4.samba.org; Guo Lucy-GLG005 Cc: Peter.Polkinghorne@brunel.ac.uk; 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@brunel.ac.uk +44 1895 274000 x2561 UK | ---------------------------------------------------------------------------- -
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 Lucy, 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 the 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 or 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 considerably. Good Luck! Scott. "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@brunel.ac.uk] > Sent: Monday, October 09, 2000 10:53 AM > To: samba@us4.samba.org; Guo Lucy-GLG005 > Cc: Peter.Polkinghorne@brunel.ac.uk; 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@brunel.ac.uk +44 1895 274000 x2561 UK > | > ---------------------------------------------------------------------------- > --- __________________________________________________________________ Scott Lawson Systems Manager Department Of Information Services St. George's Hospital Medical School Tooting London SW17 0RE UK P: 44 (0)208 725 2896 F: 44 (0)208 725 3583 mailto:s.lawson@sghms.ac.uk http://www.sghms.ac.uk Quote of the week : "The difference between 'involvement' and 'commitment' is like a bacon-and-eggs breakfast: the chicken was 'involved' - the pig was 'committed'." __________________________________________________________________