This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
my %stats; | |
{ | |
open my $fh, '<', '/proc/net/snmp' or die "$!\n"; | |
my @keys; | |
while (<$fh>) { | |
chomp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/ngx_http_headers_more_headers_in.c b/src/ngx_http_headers_more_headers_in.c | |
index c3eb8f7..527c8a5 100644 | |
--- a/src/ngx_http_headers_more_headers_in.c | |
+++ b/src/ngx_http_headers_more_headers_in.c | |
@@ -739,6 +739,7 @@ ngx_http_set_connection_header(ngx_http_request_t *r, | |
if (ngx_strcasestrn(value->data, "close", 5 - 1)) { | |
r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE; | |
r->headers_in.keep_alive_n = -1; | |
+ r->keepalive = 0; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/starter.go b/starter.go | |
index c65ce00..4d47000 100644 | |
--- a/starter.go | |
+++ b/starter.go | |
@@ -517,7 +517,6 @@ func (s *Starter) StartWorker(sigCh chan os.Signal, ch chan processState) *os.Pr | |
sigs = append(sigs, sig) | |
} | |
} | |
- | |
// if received any signals, during the wait, we bail out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use JSON; | |
sub cap_cmd { | |
my ($cmdref) = @_; | |
pipe my $logrh, my $logwh | |
or die "Died: failed to create pipe:$!\n"; | |
my $pid = fork; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nobody nobody; | |
daemon off; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
worker_rlimit_nofile 200000; | |
worker_processes 1; | |
pcre_jit on; | |
events { | |
use epoll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# perl memcached.pl | |
Rate pp fast | |
pp 21167/s -- -89% | |
fast 197745/s 834% -- | |
# perl -Ilib -Iblib/arch eg/benchmark.pl | |
single get ======= | |
Rate redis fast hiredis jet | |
redis 34841/s -- -56% -68% -71% | |
fast 80082/s 130% -- -27% -33% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use IO::Handle; | |
use Getopt::Long; | |
use File::Spec; | |
sub find_path { | |
my $pg = shift; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Plack::App::CGIBin; | |
use Plack::App::PHPCGIFile; | |
use Plack::Builder; | |
use Plack::Builder::Conditionals; | |
my $cgibin = Plack::App::CGIBin->new( | |
root => "/usr/local/nagios/sbin", | |
exec_cb => sub { my $file = shift; $file =~ m!\.cgi$! and -x $file }, | |
)->to_app; | |
my $htdocs = Plack::App::PHPCGIFile->new( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use JSON; | |
sub cap_cmd { | |
my ($cmdref) = @_; | |
pipe my $logrh, my $logwh | |
or die "Died: failed to create pipe:$!\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl stats_elb.pl --region us-west-2 --elb ProdElb | mkr throw --service production |