"Florian Weimer" <fw (AT) deneb (DOT) enyo.de> wrote
Quote:
Berkeley DB typically uses mmap instead of System V shared memory
segments. |
Well, that's the thing.

I'd rather have it use System V shared memory.
I do the following to open the environment (in Perl):
if (not eval {$env = new BerkeleyDB::Env
-Cachesize => 16777216,
-Home => '/var/db/smtpd',
-ErrFile => '/var/log/smtpd-BerkeleyDB.log',
-SharedMemKey => 1234,
-ErrPrefix => 'smtpd',
-Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL}) {
log ("Cannot open BerkeleyDB environment: " . \
(($_ = $BerkeleyDB::Error) ? ($_) : ($!)));
But with the 'SharedMemKey' addition, I get some weird error, like:
"Numerical argument out of domain" (whatever that means: there's way too
many google references for that one, and none associated with
SharedMemKey).
Problem is, I don't want to cache to file, as this is a forking daemon,
and each child needs to open the BerkeleyDB environment individually. So
when the child exits, a new-spawm child would have to fetch all cache data
all over from file again. I'd rather have BerkeleyDB use the available
System V shared memory; I have ~100MB unused of it:
{root} % sysctl kern.ipc | grep shmall
kern.ipc.shmall: 24576
(those are 4K pages).
So, any idea to get System V shared memory going with BerkeleyDB?
At any rate, thanks for your help so far.
- Mark