about summary refs log tree commit homepage
path: root/lib/PublicInbox/Qspawn.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-28 19:26:56 +0000
committerEric Wong <e@80x24.org>2019-06-29 19:59:00 +0000
commit8922459f0fa7265cfe3dee21f56895aeeb560d47 (patch)
tree6e4669f9a18efb95db84fe06e4dd3b164d75f085 /lib/PublicInbox/Qspawn.pm
parent21a539a2df0cbbc929aecec88f9fd6879e20f466 (diff)
downloadpublic-inbox-8922459f0fa7265cfe3dee21f56895aeeb560d47.tar.gz
Linux pipes default to 65536 bytes in size, and we want to read
external processes as fast as possible now that we don't use
Danga::Socket or buffer to heap.

However, drop the buffer ASAP if we need to wait on anything;
since idle buffers can be idle for eons.  This lets other
execution contexts can reuse that memory right away.
Diffstat (limited to 'lib/PublicInbox/Qspawn.pm')
-rw-r--r--lib/PublicInbox/Qspawn.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm
index f2630a0f..8f0b9fe2 100644
--- a/lib/PublicInbox/Qspawn.pm
+++ b/lib/PublicInbox/Qspawn.pm
@@ -128,7 +128,7 @@ sub psgi_qx {
         my $rpipe; # comes from popen_rd
         my $async = $env->{'pi-httpd.async'};
         my $cb = sub {
-                my $r = sysread($rpipe, my $buf, 8192);
+                my $r = sysread($rpipe, my $buf, 65536);
                 if ($async) {
                         $async->async_pass($env->{'psgix.io'}, $qx, \$buf);
                 } elsif (defined $r) {