After running some tests with worker MPM against SQLite3 database, it
turns out that performance can be improved by doing linear backoff in
the wait loop (although SQLite is still quite bad when it comes to
highly concurrent apps). Patch is attached.
Comments?
--
Bojan
Index: dbd/apr_dbd_sqlite3.c
===================================================================
--- dbd/apr_dbd_sqlite3.c (revision 680260)
+++ dbd/apr_dbd_sqlite3.c (working copy)
@@ -29,8 +29,8 @@
#include "apr_dbd_internal.h"
-#define MAX_RETRY_COUNT 15
-#define MAX_RETRY_SLEEP 100000
+#define MAX_RETRY_COUNT 24
+#define MAX_RETRY_SLEEP 5000
struct apr_dbd_transaction_t {
int mode;
@@ -112,7 +112,7 @@
ret = SQLITE_ERROR;
} else {
apr_dbd_mutex_unlock();
- apr_sleep(MAX_RETRY_SLEEP);
+ apr_sleep(retry_count * MAX_RETRY_SLEEP);
apr_dbd_mutex_lock();
}
} else if (ret == SQLITE_ROW) {