about summary refs log tree commit homepage
path: root/lib/PublicInbox/Daemon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-11 09:41:29 +0000
committerEric Wong <e@80x24.org>2023-09-11 18:51:15 +0000
commit57bc493d8e137f50343c8ef9256255b8963dab30 (patch)
tree14491c007c52ca741fedec79420ff7d59648ae8d /lib/PublicInbox/Daemon.pm
parent3005c1bc5d053222892553f14334d86febb72797 (diff)
downloadpublic-inbox-57bc493d8e137f50343c8ef9256255b8963dab30.tar.gz
public-inbox-watch, lei-daemon, the master process of
public-inbox-(netd|httpd|imapd|nntpd|pop3d),
and the (mostly) Perl implementation of XapHelper do not
have many FDs to watch so epoll|kqueue end up being overkill.

Of course, *BSDs already have separate kqueue FDs emulating
signalfd and/or inotify, even.

In other words, only the worker processes of
public-inbox-(netd|httpd|imapd|nntpd|pop3d) are expected
to see C10K (or C100K) types of traffic where epoll|kqueue
shine.

Perhaps lei could benefit from epoll/kqueue on some virtual users
IMAP/JMAP system one day; as could -watch with many IMAP IDLE
folders; but we'll probably add a knob if/when it comes to that.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r--lib/PublicInbox/Daemon.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 222093bc..07883153 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -556,6 +556,7 @@ sub start_worker ($) {
         } elsif ($pid == 0) {
                 undef %WORKERS;
                 PublicInbox::DS::Reset();
+                local $PublicInbox::DS::Poller; # allow epoll/kqueue
                 srand($seed);
                 eval { Net::SSLeay::randomize() };
                 $set_user->() if $set_user;
@@ -677,6 +678,7 @@ sub daemon_loop () {
                 $WORKER_SIG{USR2} = sub { worker_quit() if upgrade() };
                 $refresh->();
         }
+        local $PublicInbox::DS::Poller; # allow epoll/kqueue
         worker_loop();
 }