From 305dc816525f461f9bfe640d87f671f53f0e0fc6 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Tue, 10 Oct 2017 12:11:26 -0500 Subject: [PATCH] Disable sync during iprop receive_everything() Doing an fsync per-record when receiving the complete HDB is a performance disaster. Among other things, if the HDB is very large, then one slave receving a full HDB can cause other slaves to timeout and, if HDB write activity is high enough to cause iprop log truncation, then also need full syncs, which leads to a cycle of full syncs for all slaves until HDB write activity drops. Allowing the iprop log to be larger helps, but improving receive_everything() performance helps even more. --- lib/kadm5/ipropd_slave.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/kadm5/ipropd_slave.c b/lib/kadm5/ipropd_slave.c index 868dc35cb..0ec529ccf 100644 --- a/lib/kadm5/ipropd_slave.c +++ b/lib/kadm5/ipropd_slave.c @@ -512,6 +512,8 @@ receive_everything(krb5_context context, int fd, if (ret) krb5_err(context, IPROPD_RESTART, ret, "db->open"); + (void) mydb->hdb_set_sync(context, mydb, 0); + sp = NULL; krb5_data_zero(&data); do { @@ -563,6 +565,9 @@ receive_everything(krb5_context context, int fd, reinit_log(context, server_context, vno); + ret = mydb->hdb_set_sync(context, mydb, 1); + if (ret) + krb5_err(context, IPROPD_RESTART_SLOW, ret, "failed to sync the received HDB"); ret = mydb->hdb_close(context, mydb); if (ret) krb5_err(context, IPROPD_RESTART_SLOW, ret, "db->close");