From: Tyler Riddle Date: Fri, 21 Sep 2012 23:33:16 +0000 (-0700) Subject: reduce ulimit to 200 meg; reap children X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9ca8099d416a42faaee102dc4cfa4da9bec5e55;p=scpubgit%2FObject-Remote.git reduce ulimit to 200 meg; reap children --- diff --git a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm index 291a664..a8d743f 100644 --- a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm +++ b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm @@ -8,10 +8,20 @@ use Object::Remote::Handle; use Object::Remote::Future; use Object::Remote::Logging qw( :log :dlog ); use Scalar::Util qw(blessed); +use POSIX ":sys_wait_h"; use Moo::Role; with 'Object::Remote::Role::Connector'; +BEGIN { + $SIG{CHLD} = sub { + my $kid; + do { + $kid = waitpid(-1, WNOHANG); + } while $kid > 0; + } +} + has module_sender => (is => 'lazy'); #if no child_stderr file handle is specified then stderr #of the child will be connected to stderr of the parent @@ -32,7 +42,7 @@ has perl_command => (is => 'lazy'); #TODO only works with ssh with quotes but only works locally #with out quotes #sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 80000; nice -n 15 perl -"' ] } -sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 500000; nice -n 15 perl -"' ] } +sub _build_perl_command { [ 'sh', '-c', '"ulimit -v 200000; nice -n 15 perl -"' ] } #sub _build_perl_command { [ 'perl', '-' ] } around connect => sub {