diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 7b027fa7f..f771d6068 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -12,6 +12,8 @@ use Time::HiRes qw(sleep); use Thread qw(yield); use xCAT::Client submit_request; my $clientselect = new IO::Select; +#my $sslclients = 0; #THROTTLE +#my $maxsslclients = 16; #default sub xexit { while (wait() > 0) { @@ -394,6 +396,13 @@ sub generic_reaper { $SIG{CHLD} = \&generic_reaper; } +#sub ssl_reaper { +# while (waitpid(-1,WNOHANG) > 0) { +# $sslclients--; +# } +# $SIG{CHLD} = \&ssl_reaper; +#} + sub dispatch_reaper { while (($CHILDPID =waitpid(-1, WNOHANG)) > 0) { if ($dispatched_children{$CHILDPID}) { @@ -463,9 +472,13 @@ xCAT_monitoring::monitorctrl::start($$); my $peername; my $ssltimeout; +#$SIG{CHLD} = \&ssl_reaper; #THROTTLE until ($quit) { next unless my $cnnection=$listener->accept; my $connection; + #while ($sslclients > $maxsslclients) { #THROTTLE + # yield; + #} my $child = xCAT::Utils->xfork(); #Yes we fork, IO::Socket::SSL is not threadsafe.. unless (defined $child) { @@ -473,6 +486,7 @@ until ($quit) { } if ($child == 0) { + #$SIG{CHLD} = \&generic_reaper; #THROTTLE $listener->close; $SIG{ALRM} = sub { $ssltimeout = 1; die; }; @@ -528,6 +542,7 @@ if ($inet6support) { service_connection($connection,$peername,$peerhost); xexit(0); } + #$sslclients++; #THROTTLE $cnnection->close(); } $listener->close;