--- loncom/lond 2007/10/08 17:40:56 1.385 +++ loncom/lond 2007/10/08 21:05:49 1.386 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.385 2007/10/08 17:40:56 albertel Exp $ +# $Id: lond,v 1.386 2007/10/08 21:05:49 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.385 $'; #' stupid emacs +my $VERSION='$Revision: 1.386 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -74,8 +74,6 @@ my $keymode; my $cipher; # Cipher key negotiated with client my $tmpsnum = 0; # Id of tmpputs. -my $max_children = 1; # warn when exceeding this -my $max_children_enforcing = 0; # # Connection type is: @@ -5181,12 +5179,6 @@ $server = IO::Socket::INET->new(LocalPor my %children = (); # keys are current child process IDs -sub flip_max_children_enforcing { - $max_children_enforcing = !$max_children_enforcing; - &logthis("Flipped child maximum enforcement to (". - $max_children_enforcing.")"); -} - sub REAPER { # takes care of dead children $SIG{CHLD} = \&REAPER; &status("Handling child death"); @@ -5496,7 +5488,6 @@ $SIG{INT} = $SIG{TERM} = \&HUNTSMAN; $SIG{HUP} = \&HUPSMAN; $SIG{USR1} = \&checkchildren; $SIG{USR2} = \&UpdateHosts; -$SIG{SEGV} = \&flip_max_children_enforcing; # Read the host hashes: &Apache::lonnet::load_hosts_tab(); @@ -5512,17 +5503,7 @@ while (1) { &status('Starting accept'); $client = $server->accept() or next; &status('Accepted '.$client.' off to spawn'); - my $child_count = scalar(keys(%children)); - if ($child_count > $max_children) { - &logthis("Warning too many children (".$child_count.")"); - } -# if ($child_count > $max_children && $max_children_enforcing) { -# &logthis(" Not creating new child "); -# $client->close(); -# } else { - &make_new_child($client); -# } - &logthis("Concurrent children at ($child_count)"); + make_new_child($client); &status('Finished spawning'); } @@ -5725,18 +5706,10 @@ sub make_new_child { # ------------------------------------------------------------ Process requests my $keep_going = 1; my $user_input; - my $max_size = (split("\n",`ps -o vsz $$`))[-1]; while(($user_input = get_request) && $keep_going) { alarm(120); Debug("Main: Got $user_input\n"); $keep_going = &process_request($user_input); - if (!$max_children_enforcing) { - my $new_size = (split("\n",`ps -o vsz $$`))[-1]; - if ($new_size > $max_size) { - &logthis("size increase of ".($new_size-$max_size)." ($new_size) while processing (".length($user_input).")\n".substr($user_input,0,80)); - $max_size = $new_size; - } - } alarm(0); &status('Listening to '.$clientname." ($keymode)"); } @@ -6417,7 +6390,7 @@ sub sethost { eq &Apache::lonnet::get_host_ip($hostid)) { $currenthostid =$hostid; $currentdomainid=&Apache::lonnet::host_domain($hostid); - #&logthis("Setting hostid to $hostid, and domain to $currentdomainid"); + &logthis("Setting hostid to $hostid, and domain to $currentdomainid"); } else { &logthis("Requested host id $hostid not an alias of ". $perlvar{'lonHostID'}." refusing connection");