[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

SQLite locking for WCNG on NFS

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 14 Feb 2012 09:48:13 +0000

WCNG has poor performance when the working copy is on an NFS, or other
network disk. Subversion has always been significantly slower with
working copies on network, rather than local disks, but 1.7 is worse
than 1.6. I believe 1.7 performance is dominated by SQLite transaction
overhead, and that reducing the number of transactions improves
performance. However checkout is a big problem since it does a large
number of transactions. For example a checkout of a Subversion trunk
working copy:

1.7 local disk 3.9s
1.7 NFS disk 2m56s
1.6 NFS disk 1m26s

I've noticed that SQLite has a locking mode pragma, so I tried enabling
"pragma locking_mode=exclusive" to see what effect it has:

1.7 local disk 3.2s
1.7 NFS disk 55s

A substantial performance improvement but at the cost of making write
operations block read operations. This would mean things like TSVN
would not be able to run status on a working copy while its checkout was
running.

Still it's hard to ignore the performance gain. Perhaps we could make
it (whispers) configurable?

Index: ../src/subversion/libsvn_wc/wc_db_util.c
===================================================================
--- ../src/subversion/libsvn_wc/wc_db_util.c (revision 1243475)
+++ ../src/subversion/libsvn_wc/wc_db_util.c (working copy)
@@ -125,6 +125,8 @@
                            my_statements ? my_statements : statements,
                            0, NULL, result_pool, scratch_pool));
 
+ SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_PRAGMA_LOCKING_MODE));
+
   SVN_ERR(svn_sqlite__create_scalar_function(*sdb, "relpath_depth", 1,
                                              relpath_depth, NULL));
 
Index: ../src/subversion/libsvn_wc/wc-queries.sql
===================================================================
--- ../src/subversion/libsvn_wc/wc-queries.sql (revision 1243475)
+++ ../src/subversion/libsvn_wc/wc-queries.sql (working copy)
@@ -1411,6 +1411,9 @@
 
 /* ------------------------------------------------------------------------- */
 
+-- STMT_PRAGMA_LOCKING_MODE
+pragma locking_mode = exclusive
+
 /* Grab all the statements related to the schema. */
 
 -- include: wc-metadata

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2012-02-14 12:57:04 CET

This is an archived mail posted to the Subversion Dev mailing list.