3 ms·
I'm surprised it's not the default. I agree it should be. I wonder why it's not... There must be some good reason? This page verifies that what you're saying is
by ksikka 11y ago
I'm surprised it's not the default. I agree it should be. I wonder why it's not... There must be some good reason?
This page verifies that what you're saying is actually correct-
http://pybsddb.sourceforge.net/ref/env/region.html http://pybsddb.sourceforge.net/ref/env/region.html
Update: Architecture dependence and having to release shared memory after a crash, are two possible reasons BDB defaults to mmap rather than shared memory.
- hyc_symas 11y agoThe BDB mmmap cache actually worked fine for many years, on older OSs. They didn't keep accurate track of which memory pages were dirtied or when, so they were pretty lazy about flushing changes back to disk. This made an mmap'd file functionally equivalent to a SysV shared memory region. I remember when Linux changed in the 2.6 series, and suddenly using an mmap'd file got incredibly slow, because the kernel was proactively flushing dirtied pages back to disk. We started recommending SysV shm for all our deployments after that. You had to be careful in configuring this, since SysV shm wasn't swappable or pageable.
- ksikka 11y agoIncredibly insightful. Thank you!