[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: caching magic (was: How to trace activity on Window platform ?)

uh oh
this is beginning to seriously confuse me :)

from the set_cachesize doc on sleepycat (http://www.sleepycat.com/docs/api_c/db_set_cachesize.html)
I learned that ".. if ncache is 0 or 1, the cache will be allocated contiguously in memory."

So I figure that if, for performance reasons, I want to put my db entirely in memory, I have two options
1) measure the size of the db (and indices) on the file system. use the set_cachesize directive in DB_CONFIG with a larger size and ncache set to 0 or 1 (and db_recover after the changes to DB_CONFIG)
2) measure the number of entries in the db. use the cachesize directive in slapd.conf to set it to something larger

I understand that 1) would be a server-wide configuration and 2) is a database specific configuration (one server can have many databases)

But my questions:

- in case my server only has one database: are 1) and 2) equivalent? i.e. can I chose one of either cachsize or set_cachesize and ignore the other?
- if i set both, what are the effects or the caveats?
- what does shm_key do again?
- why does setting shm_key fail on my RH enterprise 3.0 box (I tried different values, the debug error is always something like shmget: key: 9: unable to create shared system memory region: Invalid argument) but not on my Solaris 8 box (both have 2GB of memory, both are configured identically with set_cachesize  0 214748365 0 in DB_CONFIG)?

thanks for any enlightnment

--On Tuesday, June 15, 2004 11:16 AM +0200 Frank Hoffsummer <frank.hoffsummer@svt.se> wrote:

> thanks quanah for your answers
> so setting  set_cachesize in DB_CONFIG to something larger than the size
> of my DBs and then
> setting shm_key to something positive in slapd.conf will keep the entire
> DB in memory?
> the relation between shm_key and set_cachesize isnt clear to me.....

shm_key tells Slapd what shared memory key to use on the system. (X)

set_cachesize tells BDB how large of a cache to create. (Y)

The two parameters together will try to create a shared memory segment with memory key X of size Y


Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html