]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: avoid sync append for small ios
authorSage Weil <sage@redhat.com>
Wed, 29 Apr 2015 18:52:55 +0000 (11:52 -0700)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:42 +0000 (13:39 -0400)
An append is expensive in terms of latency (write, fdatasync, kv commit),
while a wal write is just the kv commit and the write and fdatasync are
async.  For small IOs doing the wal may improve performance.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/os/newstore/NewStore.cc

index b83fef4f83023139962f7ded0792adba8aae42f4..6463595e9b7e0576a390be70f8ced5e231d71ce6 100644 (file)
@@ -803,6 +803,7 @@ OPTION(newstore_fsync_thread_suicide_timeout, OPT_INT, 120) // suicide timeout v
 OPTION(newstore_wal_threads, OPT_INT, 4)
 OPTION(newstore_wal_thread_timeout, OPT_INT, 30)
 OPTION(newstore_wal_thread_suicide_timeout, OPT_INT, 120)
+OPTION(newstore_sync_append_min, OPT_INT, 65536)  // only do sync append for large ios
 OPTION(newstore_max_ops, OPT_U64, 512)
 OPTION(newstore_max_bytes, OPT_U64, 64*1024*1024)
 OPTION(newstore_wal_max_ops, OPT_U64, 512)
index 33c322a2c2360fc62cfab7f51193e420bfbcb7e5..aac07485497c0ccbe19cb89b88e2be2dc5ceb8dc 100644 (file)
@@ -3320,8 +3320,9 @@ int NewStore::_do_write(TransContext *txc,
     }
   }
 
-  if (o->onode.size <= offset ||
-      o->onode.size == 0 ||
+  if (((o->onode.size <= offset || o->onode.size == 0) &&
+       length >= g_conf->newstore_sync_append_min) ||
+
       o->onode.data_map.empty()) {
     uint64_t x_offset;
     if (o->onode.data_map.empty()) {