Shared Memory

MCCALL,DON (HP-USA,ex1) don_mccall at
Wed Oct 10 10:24:14 GMT 2001

Hi Todd,
You should probably respond to the list samba at, so others
the chance to offer suggestions as well.

I looked at the code, and I don't see any ifdefs, etc. that should require 
that you recompile samba to use the smb.conf parameter "shared mem size=".
And I was able to set "shared mem size=5242880" (5 mbytes) on my HP-UX
with no problem; you can verify that it actually takes (you have to bring
DOWN, AND remove the current shared memory and semaphore entries from the
before this will take effect - samba does not destroy it's shared memory
when it is brought down, and will check to see if it's there on comming up
attach to it if it is, rather than recreating it) by immediately doing a
smbstatus after bringing samba up, as it creates the shared memory segment
on first connection if it
does not exist.
What I had to do was the following:

1. added shared mem size = 5242880  to the global section of my smb.conf
2. killed nmbd and smbd
3. ipcrm -M 0x00280267  (remove the samba shared memory segment)
4. ipcrm -S 0x00280269  (remove the samba semaphore)
5. nmbd -D
6. smbd -D
7. smbstatus (which gave the following):

	 Samba version 2.0.7
	Service      uid      gid      pid     machine

	Initialised IPC area of size 5242880
	No locked files

	Share mode memory usage (bytes):
   	5242768(99%) free + 56(0%) used + 56(0%) overhead = 5242880(100%)

If your kernel parameters do not ALLOW a shared memory segment as large as
request, samba will attempt to use a smaller size, until it gets a size that
system WILL accept.  So if the above doesn't work for you, you may want to
your kernel parameters to see what the maximum shared memory segment size is
for (how to find that out, I don't know, on your particular os...)

Hope this helps,

-----Original Message-----
From: ANELLOT at [mailto:ANELLOT at]
Sent: Wednesday, October 10, 2001 12:51 PM
Subject: RE: Shared Memory

I appreciate the time, samba just paniced again so I am being told to take
us back to our alternative solution. I had tested samba on a sister system
to this one and it worked just fine. But it did not have 183 concurrent
connections like this one does. This machine gets down to 5% free shared
mem and that is when the panics take place. I tried changing the variable
is swat but it never takes. I know if I could give it more memory it would
be fine. I do remember someone saying something about recompilling in order
to change shared memory settings but I never saw any docs anywhere.

Thanks again for the input,

More information about the samba mailing list