unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] mbox: be fair to other HTTP clients
@ 2016-08-06  2:06 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-08-06  2:06 UTC (permalink / raw)
  To: meta

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


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

only message in thread, other threads:[~2016-08-06  2:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-06  2:06 [PATCH] mbox: be fair to other HTTP clients Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).