]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
*index: increase default --commit-interval to 15s
authorEric Wong <e@80x24.org>
Sat, 6 Sep 2025 19:45:06 +0000 (19:45 +0000)
committerEric Wong <e@80x24.org>
Sat, 6 Sep 2025 19:45:06 +0000 (19:45 +0000)
The DBD::SQLite(3pm) sqlite_busy_timeout is 30s and we don't
currently have a way to override this.  Thus 15s should be
adequate assuming we can keep SQLite commit times <10s.
Currently, the worst case commit times can exceed even 30s for
Xapian, but that doesn't affect over.sqlite3 which commits
fairly quickly.

lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/SearchIdx.pm

index 4719c8805bf8ff02d14a8f657577678ceaacae80..c60b6f43f1c161c365dddd9cc61074363f1b89a1 100644 (file)
@@ -1333,8 +1333,9 @@ sub on_inbox_unlock { # called by PublicInbox::InboxIdle
        $pr->("indexing $ekey\n") if $pr;
        $self->idx_init($opt);
        sync_inbox $self, $ibx;
-       $self->{-commit_timer} //= add_timer($opt->{'commit-interval'} // 10,
-                                       \&_watch_commit, $self);
+       $self->{-commit_timer} //= add_timer($opt->{'commit-interval'} //
+                               $PublicInbox::SearchIdx::CHECKPOINT_INTVL,
+                               \&_watch_commit, $self);
 }
 
 sub eidx_reload { # -extindex --watch SIGHUP handler
index fef1892b1bc240b2ad593ee28ec4218b6e30dc53..0cd7a046b90117070728e765652b65ed94d2fc29 100644 (file)
@@ -36,7 +36,7 @@ my $X = \%PublicInbox::Search::X;
 our ($DB_CREATE_OR_OPEN, $DB_OPEN);
 our $DB_NO_SYNC = 0;
 our $DB_DANGEROUS = 0;
-our $CHECKPOINT_INTVL = 5; # seconds
+our $CHECKPOINT_INTVL = 15; # seconds
 our $DEFRAG_NR = 100000; # document count
 our $BATCH_BYTES = $ENV{XAPIAN_FLUSH_THRESHOLD} ? 0x7fffffff :
        # assume a typical 64-bit system has 8x more RAM than a