From: huanwen ren Date: Tue, 13 Mar 2018 02:35:10 +0000 (+0800) Subject: client: add the fuse parameter max_write X-Git-Tag: v13.1.0~426^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8dbc5c9d1c4db88f923ca2ada6a0e425c3d33b95;p=ceph.git client: add the fuse parameter max_write This parameter has the following 2 advantages: 1. FUSE(version > 2.8) the default single IO write size is 128k (controlled by max_write), if I use bs=4M in the FIO tool test, you will find that 4*1024k/128=32 is needed, ie 32 IO operations are needed . If I adjust max_write to 4M, only one operation is needed, which greatly improves the write performance of cephfs during fuse mount. Of course, the above implementation requires libfuse and kernel fuse to support. 2. In addition, we can also limit the single IO write size by setting max_write to less than 128K. Signed-off-by: huanwen ren --- diff --git a/doc/cephfs/client-config-ref.rst b/doc/cephfs/client-config-ref.rst index da462486ad4f..931756446e50 100644 --- a/doc/cephfs/client-config-ref.rst +++ b/doc/cephfs/client-config-ref.rst @@ -177,6 +177,12 @@ :Type: Boolean :Default: ``true`` +``fuse max write`` + +:Description: Set the maximum number of bytes in a single write operation. Because the FUSE default is 128kbytes, SO fuse_max_write default set to 0(The default does not take effect) +:Type: Integer +:Default: ``0`` + Developer Options ################# diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 49597b7bb32e..353782a89672 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -1095,6 +1095,8 @@ int CephFuse::Handle::init(int argc, const char *argv[]) "fuse_atomic_o_trunc"); auto fuse_debug = client->cct->_conf->get_val( "fuse_debug"); + auto fuse_max_write = client->cct->_conf->get_val( + "fuse_max_write"); if (fuse_allow_other) { newargv[newargc++] = "-o"; @@ -1109,6 +1111,13 @@ int CephFuse::Handle::init(int argc, const char *argv[]) newargv[newargc++] = "-o"; newargv[newargc++] = "big_writes"; } + if (fuse_max_write > 0) { + char strsplice[65]; + newargv[newargc++] = "-o"; + newargv[newargc++] = strsplice; + sprintf(strsplice, "max_write=%" PRIu64, fuse_max_write); + newargv[newargc++] = strsplice; + } if (fuse_atomic_o_trunc) { newargv[newargc++] = "-o"; newargv[newargc++] = "atomic_o_trunc"; diff --git a/src/common/options.cc b/src/common/options.cc index aced1b52d8fe..dcf4d57d06e5 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -7047,6 +7047,10 @@ std::vector