projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d743301
)
Turn off readahead on main mmap
author
Howard Chu
<hyc@symas.com>
Mon, 11 Mar 2013 12:49:14 +0000
(
05:49
-0700)
committer
Howard Chu
<hyc@symas.com>
Mon, 11 Mar 2013 12:49:14 +0000
(
05:49
-0700)
It's harmful when the DB is larger than RAM.
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index
058c68b
..
c086bd9
100644
(file)
--- a/
libraries/liblmdb/mdb.c
+++ b/
libraries/liblmdb/mdb.c
@@
-2870,6
+2870,8
@@
mdb_env_open2(MDB_env *env)
env->me_map = NULL;
return ErrCode();
}
+ /* Turn off readahead. It's harmful when the DB is larger than RAM. */
+ posix_madvise(env->me_map, env->me_mapsize, POSIX_MADV_RANDOM);
#endif
if (newenv) {