mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Make flush_writes the default. Change option to 'dbcachenowsync'.
Change backend struct option to li_dbcachewsync.
This commit is contained in:
parent
f67adafb44
commit
3f1b97481c
7 changed files with 14 additions and 7 deletions
|
|
@ -266,6 +266,10 @@ by the LDBM backend database instance. The default is 1000 entries.
|
|||
Specify the size in bytes of the in-memory cache associated
|
||||
with each open index file. If not supported by the underlying database
|
||||
method, this option is ignored without comment. The default is 100000 bytes.
|
||||
.B dbcachenowsync
|
||||
Specify that database writes should not be immediately synchronized
|
||||
with in memory changes. Enabling this option may improving performance
|
||||
at the expense of data security.
|
||||
.TP
|
||||
.B directory <directory>
|
||||
Specify the directory where the LDBM files containing the database and
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ struct ldbminfo {
|
|||
struct cache li_cache;
|
||||
Avlnode *li_attrs;
|
||||
int li_dbcachesize;
|
||||
int li_flush_wrt;
|
||||
int li_dbcachewsync;
|
||||
struct dbcache li_dbcache[MAXDBCACHE];
|
||||
pthread_mutex_t li_dbcache_mutex;
|
||||
pthread_cond_t li_dbcache_cv;
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ ldbm_back_config(
|
|||
}
|
||||
li->li_dbcachesize = atoi( argv[1] );
|
||||
|
||||
/* flush on writes */
|
||||
} else if ( strcasecmp( argv[0], "flushwrites" ) == 0 ) {
|
||||
li->li_flush_wrt = 1;
|
||||
/* no write sync */
|
||||
} else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
|
||||
li->li_dbcachewsync = 0;
|
||||
|
||||
/* anything else */
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ dn2id_add(
|
|||
data.dsize = sizeof(ID);
|
||||
|
||||
flags = LDBM_INSERT;
|
||||
if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
|
||||
if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
|
||||
|
||||
rc = ldbm_cache_store( db, key, data, flags );
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ id2entry_add( Backend *be, Entry *e )
|
|||
|
||||
/* store it */
|
||||
flags = LDBM_REPLACE;
|
||||
if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
|
||||
if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
|
||||
rc = ldbm_cache_store( db, key, data, flags );
|
||||
|
||||
pthread_mutex_unlock( &entry2str_mutex );
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ idl_store(
|
|||
#endif
|
||||
|
||||
flags = LDBM_REPLACE;
|
||||
if( li->li_flush_wrt ) flags |= LDBM_SYNC;
|
||||
if( li->li_dbcachewsync ) flags = LDBM_SYNC;
|
||||
rc = ldbm_cache_store( db, key, data, flags );
|
||||
|
||||
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ ldbm_back_init(
|
|||
/* default database cache size */
|
||||
li->li_dbcachesize = DEFAULT_DBCACHE_SIZE;
|
||||
|
||||
/* default cache mode is sync on write */
|
||||
li->li_dbcachewsync = 1;
|
||||
|
||||
/* default file creation mode */
|
||||
li->li_mode = DEFAULT_MODE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue