Change backend struct option to li_dbcachewsync.
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
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;
}
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 {
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 );
/* 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 );
#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 ); */
/* 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;