user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] searchidx: default BATCH_BYTES to 8MB on 64-bit systems
@ 2021-06-30 17:58 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-06-30 17:58 UTC (permalink / raw)
  To: meta

This default seems closer to reasonable on 64-bit systems which
are the norm these days.  32-bit systems gain 48K so it's an
even 1 MB, but we need to keep 32-bit systems from using too
much since there's still some ancient systems out there with
small inboxes.
 lib/PublicInbox/ | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index 65764cc8..f4f3ba34 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -24,12 +24,17 @@ use PublicInbox::Spawn qw(spawn nodatacow_dir);
 use PublicInbox::Git qw(git_unquote);
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::Address;
+use Config;
 our @EXPORT_OK = qw(log2stack is_ancestor check_size prepare_stack
 	index_text term_generator add_val is_bad_blob);
 my $X = \%PublicInbox::Search::X;
 our $DB_NO_SYNC = 0;
-our $BATCH_BYTES = $ENV{XAPIAN_FLUSH_THRESHOLD} ? 0x7fffffff : 1_000_000;
+	# assume a typical 64-bit system has 8x more RAM than a
+	# typical 32-bit system:
+	(($Config{ptrsize} >= 8 ? 8192 : 1024) * 1024);
 use constant DEBUG => !!$ENV{DEBUG};
 my $xapianlevels = qr/\A(?:full|medium)\z/;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-30 17:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 17:58 [PATCH] searchidx: default BATCH_BYTES to 8MB on 64-bit systems Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ \
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for project(s) associated with this inbox:

AGPL code for this site: git clone