On Wed, Dec 01, 2021 at 01:03:39PM -0500, Bruce Fields wrote: > On Wed, Dec 01, 2021 at 12:42:05PM -0500, Bruce Fields wrote: > > On Wed, Dec 01, 2021 at 09:36:30AM -0500, Bruce Fields wrote: > > > OK, good to know. It'd be interesting to dig into where nfsdcltrack is > > > spending its time, which we could do by replacing it with a wrapper that > > > runs the real nfsdcltrack under strace. > > > > > > Though maybe it'd be better to do this on a system using nfsdcld, since > > > that's what we're transitioning to. > > > > Trying that on a test VM here, I see each upcall doing 3 fdatasyncs() of > > an sqlite-journal file. On my setup, each of those is taking a few > > milliseconds. I wonder if it an do better. > > If I understand the sqlite documentation correctly, I *think* that if we > use journal_mode WAL with synchronous FULL, we should get the assurances > nfsd needs with one sync per transaction. So I *think* that would mean just doing something like (untested, don't have much idea what I'm doing): diff --git a/utils/nfsdcld/sqlite.c b/utils/nfsdcld/sqlite.c index 03016fb95823..b30f2614497b 100644 --- a/utils/nfsdcld/sqlite.c +++ b/utils/nfsdcld/sqlite.c @@ -826,6 +826,13 @@ sqlite_prepare_dbh(const char *topdir) goto out_close; } + ret = sqlite3_exec(dbh, "PRAGMA journal_mode = WAL;", NULL, NULL, NULL); + if (ret) + goto out_close; + ret = sqlite3_exec(dbh, "PRAGMA synchronous = FULL;", NULL, NULL, NULL); + if (ret) + goto out_close; + ret = sqlite_query_schema_version(); switch (ret) { case CLD_SQLITE_LATEST_SCHEMA_VERSION: I also wonder how expensive may be the extra overhead of starting up nfsdcltrack each time. --b.