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=-5.4 required=3.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD,URIBL_BLOCKED shortcircuit=no autolearn=unavailable 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 1FEB41FCBF for ; Sun, 22 May 2016 20:57:36 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/5] git-http-backend: remove process limit Date: Sun, 22 May 2016 20:57:31 +0000 Message-Id: <20160522205734.12316-3-e@80x24.org> In-Reply-To: <20160522205734.12316-1-e@80x24.org> References: <20160522205734.12316-1-e@80x24.org> List-Id: We will figure out a different way to avoid overloading... --- lib/PublicInbox/GitHTTPBackend.pm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index b58cc30..35c3383 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -11,14 +11,6 @@ use IO::File; use PublicInbox::Spawn qw(spawn); use HTTP::Date qw(time2str); -# TODO: make configurable, but keep in mind it's better to have -# multiple -httpd worker processes which are already scaled to -# the proper number of CPUs and memory. git-pack-objects(1) may -# also use threads and bust memory limits, too, so I recommend -# limiting threads to 1 (via `pack.threads` knob in git) for serving. -my $LIMIT = 1; -my $nr_running = 0; - # n.b. serving "description" and "cloneurl" should be innocuous enough to # not cause problems. serving "config" might... my @text = qw[HEAD info/refs @@ -54,7 +46,6 @@ sub r ($) { sub serve { my ($cgi, $git, $path) = @_; - return serve_dumb($cgi, $git, $path) if $nr_running >= $LIMIT; my $service = $cgi->param('service') || ''; if ($service =~ /\Agit-\w+-pack\z/ || $path =~ /\Agit-\w+-pack\z/) { @@ -243,7 +234,6 @@ sub serve_smart { $wpipe = $in = undef; $buf = ''; my ($vin, $fh, $res); - $nr_running++; # Danga::Socket users, we queue up the read_enable callback to # fire after pending writes are complete: @@ -264,7 +254,6 @@ sub serve_smart { # PublicInbox::HTTPD::Async::close: $rpipe->close; $rpipe = undef; - $nr_running--; } if (defined $pid) { my $e = $pid == waitpid($pid, 0) ?