From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9FA8920193 for ; Sat, 6 Aug 2016 02:06:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] mbox: be fair to other HTTP clients Date: Sat, 6 Aug 2016 02:06:54 +0000 Message-Id: <20160806020654.28427-1-e@80x24.org> List-Id: At least for public-inbox-httpd, this allows us to avoid having a client monopolize one event loop tick of the server for too long. It hurts throughput for the /all.mbox.gz endpoint, but I doubt anybody cares and the latency improvement for other clients would be appreciated. We already do the same fairness thing for HTML pages. --- lib/PublicInbox/Mbox.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 1e3de5b..dc41548 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -138,6 +138,9 @@ sub getline { ${$self->{buf}} = ''; return $ret; } + + # be fair to other clients on public-inbox-httpd: + return ''; } $res = $self->{cb}->($self->{opts}); $self->{msgs} = $res->{msgs}; -- EW