[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: BerkeleyDB performance on Linux
- To: Rick Jones <rick.jones2@hp.com>
- Subject: Re: BerkeleyDB performance on Linux
- From: Howard Chu <hyc@symas.com>
- Date: Mon, 08 Jan 2007 10:40:43 -0800
- Cc: OpenLDAP Devel <openldap-devel@openldap.org>
- In-reply-to: <45A28AD6.4010009@hp.com>
- References: <45A0694F.7010203@symas.com> <45A28AD6.4010009@hp.com>
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061216 Netscape/7.2 (ax) Firefox/1.5 SeaMonkey/1.5a
Rick Jones wrote:
Howard Chu wrote:
The attached patch makes O_DIRECT work on Linux in BerkeleyDB 4.5.20.
(You will need to manually define LINUX_NEEDS_PAGE_ALIGNMENT if you're
using a kernel older than 2.6.)
The main reason to use this patch is to conserve memory - ordinarily,
all the I/O that BDB does to its files gets cached in the Linux
filesystem buffer cache. This caching is redundant since BDB always
does its own caching, and it effectively makes the BDB environment
consume twice as much memory as it needs. Using O_DIRECT on I/Os
disables the filesystem buffer cache for those I/Os, thus freeing up a
sizable chunk of memory.
Long ago and far away I was having "fun" with SPECweb99 on Linux and
found that eventually the access logs would grow and cast-out otherwise
usefully cached URLs. I then found the posix_fadvise call, which can be
used to tell the system that a certain range is no longer required:
Yes, but posix_fadvise is not supported on Linux kernels before 2.6, returns
ENOSYS.
--
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/