diff options
author | Eric Wong <e@80x24.org> | 2021-09-19 12:50:26 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-19 19:52:48 +0000 |
commit | 46001a7685f11cfe2b9263b0eb38478c8e951585 (patch) | |
tree | 02f29067755ce1430290bce777fb4073abf2dd54 /lib/PublicInbox/LeiNoteEvent.pm | |
parent | ee355020415fbbebbeb8fbe79be4e4f3fa2e657b (diff) | |
download | public-inbox-46001a7685f11cfe2b9263b0eb38478c8e951585.tar.gz |
"All" my CPUs is only 4, but it's probably ridiculous for somebody with a 16-core system to have 16 processes for accessing SQLite DBs. We do the same thing in Pmdir for parallel Maildir access (and V2Writable).
Diffstat (limited to 'lib/PublicInbox/LeiNoteEvent.pm')
-rw-r--r-- | lib/PublicInbox/LeiNoteEvent.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiNoteEvent.pm b/lib/PublicInbox/LeiNoteEvent.pm index 5f692e75..a0591a09 100644 --- a/lib/PublicInbox/LeiNoteEvent.pm +++ b/lib/PublicInbox/LeiNoteEvent.pm @@ -80,8 +80,9 @@ sub lei_note_event { my $self = $cfg->{-lei_note_event} //= do { my $wq = bless { lms => $lms }, __PACKAGE__; # MUAs such as mutt can trigger massive rename() storms so - # use all CPU power available: + # use some CPU, but don't overwhelm slower storage, either my $jobs = $wq->detect_nproc // 1; + $jobs = 4 if $jobs > 4; # same default as V2Writable my ($op_c, $ops) = $lei->workers_start($wq, $jobs); $lei->wait_wq_events($op_c, $ops); note_event_arm_done($lei); |