about summary refs log tree commit homepage
path: root/lib/PublicInbox/Daemon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-05 08:29:54 +0000
committerEric Wong <e@80x24.org>2022-08-06 06:34:45 +0000
commitd1024533712e32fde9c9812e604661ffc9e79019 (patch)
tree596befe523eeb3d85eb15af9b8d6074d476f20d7 /lib/PublicInbox/Daemon.pm
parent27876bd1269d18f697847a724a8465318cb3cd67 (diff)
downloadpublic-inbox-d1024533712e32fde9c9812e604661ffc9e79019.tar.gz
This means all Inbox, Git, Over, Msgmap, Search objects also get
deduplicated if they belong to the same config file, reducing
memory and FD usage.  This helps save memory and improve cache
hit rates in -netd setups where NNTP, IMAP, HTTP, and POP3
servers run in the same process.

InboxIdle was the only bit which needed adjustment, but there
may be other bugs lurking despite all tests passing.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r--lib/PublicInbox/Daemon.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 86234771..b6f4f9ed 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -22,6 +22,7 @@ use PublicInbox::Sigfd;
 use PublicInbox::Git;
 use PublicInbox::GitAsyncCat;
 use PublicInbox::Eml;
+use PublicInbox::Config;
 our $SO_ACCEPTFILTER = 0x1000;
 my @CMD;
 my ($set_user, $oldset);
@@ -653,8 +654,10 @@ sub defer_accept ($$) {
 
 sub daemon_loop ($) {
         my ($xnetd) = @_;
+        local $PublicInbox::Config::DEDUPE = {}; # enable dedupe cache
         my $refresh = sub {
                 my ($sig) = @_;
+                %$PublicInbox::Config::DEDUPE = (); # clear cache
                 for my $xn (values %$xnetd) {
                         delete $xn->{tlsd}->{ssl_ctx}; # PublicInbox::TLS::start
                         eval { $xn->{refresh}->($sig) };