mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	-Try throttling for mass deployments
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1371 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -12,8 +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
 | 
			
		||||
my $sslclients = 0; #THROTTLE
 | 
			
		||||
my $maxsslclients = 16; #default
 | 
			
		||||
 | 
			
		||||
sub xexit {
 | 
			
		||||
   while (wait() > 0) {
 | 
			
		||||
@@ -472,13 +472,13 @@ xCAT_monitoring::monitorctrl::start($$);
 | 
			
		||||
 | 
			
		||||
my $peername;
 | 
			
		||||
my $ssltimeout;
 | 
			
		||||
#$SIG{CHLD} = \&ssl_reaper; #THROTTLE
 | 
			
		||||
$SIG{CHLD} = \&ssl_reaper; #THROTTLE
 | 
			
		||||
until ($quit) {
 | 
			
		||||
  next unless my $cnnection=$listener->accept;
 | 
			
		||||
  my $connection;
 | 
			
		||||
  #while ($sslclients > $maxsslclients) { #THROTTLE
 | 
			
		||||
  #    yield;
 | 
			
		||||
  #}
 | 
			
		||||
  while ($sslclients > $maxsslclients) { #THROTTLE
 | 
			
		||||
      yield;
 | 
			
		||||
  }
 | 
			
		||||
  my $child = xCAT::Utils->xfork(); #Yes we fork, IO::Socket::SSL is not threadsafe..
 | 
			
		||||
  
 | 
			
		||||
  unless (defined $child) {
 | 
			
		||||
@@ -486,7 +486,7 @@ until ($quit) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if ($child == 0) {
 | 
			
		||||
    #$SIG{CHLD} = \&generic_reaper; #THROTTLE
 | 
			
		||||
    $SIG{CHLD} = \&generic_reaper; #THROTTLE
 | 
			
		||||
    $listener->close;
 | 
			
		||||
 | 
			
		||||
    $SIG{ALRM} = sub { $ssltimeout = 1; die; }; 
 | 
			
		||||
@@ -542,7 +542,7 @@ if ($inet6support) {
 | 
			
		||||
    service_connection($connection,$peername,$peerhost);
 | 
			
		||||
    xexit(0);
 | 
			
		||||
  }
 | 
			
		||||
  #$sslclients++; #THROTTLE
 | 
			
		||||
  $sslclients++; #THROTTLE
 | 
			
		||||
  $cnnection->close();
 | 
			
		||||
}
 | 
			
		||||
$listener->close;
 | 
			
		||||
 
 | 
			
		||||
@@ -6,3 +6,4 @@
 | 
			
		||||
42nodeperrack,"|\D+(\d+)|(1+(($1-1)/42))|","|\D+(\d+)|(($1-1)%42+1)|"
 | 
			
		||||
20nodeperrack,"|\D+(\d+)|(1+(($1-1)/20))|","|\D+(\d+)|((($1-1)%20+1)*2-1)|"
 | 
			
		||||
21nodeperrack,"|\D+(\d+)|(1+(($1-1)/21))|","|\D+(\d+)|((($1-1)%21+1)*2-1)|"
 | 
			
		||||
"idataplex","|\D+(\d+)|(1+(($1-1)/84))|","|\D+(\d+)|(sprintf(""%c"",(65+2*((($1-1)/42)%2))))-(($1-1)%42+1)|",,,,"This creates U descriptions in the form A-1 to A-42 and C-1 to C-42"
 | 
			
		||||
 
 | 
			
		||||
		
		
			
  | 
		Reference in New Issue
	
	Block a user