Commit 9f7847fc authored by Leigh Stoller's avatar Leigh Stoller

Remove hardwired load average maximum (12.0) and convert to a

config variable that defaults to 12, but is overridden to 24
on Apt, Cloud, and the MS.
parent 15047251
...@@ -714,6 +714,7 @@ PROTOGENI_EMAIL ...@@ -714,6 +714,7 @@ PROTOGENI_EMAIL
PROTOGENI_ISCLEARINGHOUSE PROTOGENI_ISCLEARINGHOUSE
PROTOGENI_WEBSITE PROTOGENI_WEBSITE
PROTOGENI_SUPPORT PROTOGENI_SUPPORT
PROTOGENI_MAXSERVERLOAD
REMOTEWIKIDOCS REMOTEWIKIDOCS
TPM TPM
DYNAMICROOTPASSWORDS DYNAMICROOTPASSWORDS
...@@ -5090,6 +5091,7 @@ PROTOGENI_GENIWEBLOGIN=0 ...@@ -5090,6 +5091,7 @@ PROTOGENI_GENIWEBLOGIN=0
GENI_PUBRPCPORT=12370 GENI_PUBRPCPORT=12370
PROTOGENI_GENIRACK=0 PROTOGENI_GENIRACK=0
PROTOGENI_NICKNAME="unknown" PROTOGENI_NICKNAME="unknown"
PROTOGENI_MAXSERVERLOAD=12
STANDALONE_CLEARINGHOUSE=0 STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0 NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0 EXP_VIS_SUPPORT=0
......
...@@ -257,6 +257,7 @@ AC_SUBST(PROTOGENI_DOMAIN) ...@@ -257,6 +257,7 @@ AC_SUBST(PROTOGENI_DOMAIN)
AC_SUBST(PROTOGENI_RPCPORT) AC_SUBST(PROTOGENI_RPCPORT)
AC_SUBST(PROTOGENI_RPCNAME) AC_SUBST(PROTOGENI_RPCNAME)
AC_SUBST(PROTOGENI_LOCALUSER) AC_SUBST(PROTOGENI_LOCALUSER)
AC_SUBST(PROTOGENI_MAXSERVERLOAD)
AC_SUBST(PROTOGENI_GENIWEBLOGIN) AC_SUBST(PROTOGENI_GENIWEBLOGIN)
AC_SUBST(GENI_PUBRPCPORT) AC_SUBST(GENI_PUBRPCPORT)
AC_SUBST(PROTOGENI_URL) AC_SUBST(PROTOGENI_URL)
...@@ -413,6 +414,7 @@ PROTOGENI_RPCPORT=12369 ...@@ -413,6 +414,7 @@ PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME="" PROTOGENI_RPCNAME=""
PROTOGENI_LOCALUSER=0 PROTOGENI_LOCALUSER=0
PROTOGENI_GENIWEBLOGIN=0 PROTOGENI_GENIWEBLOGIN=0
PROTOGENI_MAXSERVERLOAD=12
GENI_PUBRPCPORT=12370 GENI_PUBRPCPORT=12370
PROTOGENI_GENIRACK=0 PROTOGENI_GENIRACK=0
PROTOGENI_NICKNAME="unknown" PROTOGENI_NICKNAME="unknown"
......
...@@ -127,6 +127,7 @@ ISOLATEADMINS=0 ...@@ -127,6 +127,7 @@ ISOLATEADMINS=0
EC2META_ENABLE=1 EC2META_ENABLE=1
PROTOGENI_LOCALUSER=1 PROTOGENI_LOCALUSER=1
PROTOGENI_GENIWEBLOGIN=0 PROTOGENI_GENIWEBLOGIN=0
PROTOGENI_MAXSERVERLOAD=24
# #
# Fancy new browser in the console support # Fancy new browser in the console support
......
...@@ -119,6 +119,7 @@ ISOLATEADMINS=0 ...@@ -119,6 +119,7 @@ ISOLATEADMINS=0
EC2META_ENABLE=1 EC2META_ENABLE=1
PROTOGENI_LOCALUSER=1 PROTOGENI_LOCALUSER=1
PROTOGENI_GENIWEBLOGIN=0 PROTOGENI_GENIWEBLOGIN=0
PROTOGENI_MAXSERVERLOAD=24
# #
# Fancy new browser in the console support # Fancy new browser in the console support
......
...@@ -107,6 +107,8 @@ PROTOGENI_WEBSITE="www.emulab.net" ...@@ -107,6 +107,8 @@ PROTOGENI_WEBSITE="www.emulab.net"
# Set this to the nickname of your ProtoGENI federate. Ask the GPO what # Set this to the nickname of your ProtoGENI federate. Ask the GPO what
# they call you if you're not sure. # they call you if you're not sure.
PROTOGENI_NICKNAME="utah-pg" PROTOGENI_NICKNAME="utah-pg"
# This value should be 12 if you are not in Utah. Ask before changing.
PROTOGENI_MAXSERVERLOAD=24
# #
# SSL Certificate stuff. Used to customize config files in ssl directory. # SSL Certificate stuff. Used to customize config files in ssl directory.
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2008-2014 University of Utah and the Flux Group. # Copyright (c) 2008-2015 University of Utah and the Flux Group.
# #
# {{{GENIPUBLIC-LICENSE # {{{GENIPUBLIC-LICENSE
# #
...@@ -49,11 +49,15 @@ $| = 1; ...@@ -49,11 +49,15 @@ $| = 1;
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Check for excessive load as early as possible. Use config variable
# instead of sitevars cause we are trying to avoid touching anything.
#
BEGIN { BEGIN {
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin'; $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
my $uptime = `/usr/bin/uptime`; my $uptime = `/usr/bin/uptime`;
if ($uptime =~ /load averages:\s+([\.\d]+),\s+([\.\d]+),\s+[\.\d]+/) { if ($uptime =~ /load averages:\s+([\.\d]+),\s+([\.\d]+),\s+[\.\d]+/) {
if ($1 > 12.0) { if ($1 > @PROTOGENI_MAXSERVERLOAD@) {
sleep(5); sleep(5);
my $decoder = Frontier::RPC2->new(); my $decoder = Frontier::RPC2->new();
my $string = $decoder->encode_fault(503, my $string = $decoder->encode_fault(503,
...@@ -175,19 +179,6 @@ if (NoLogins()) { ...@@ -175,19 +179,6 @@ if (NoLogins()) {
XMLError(503, "CM temporarily offline; please try again later"); XMLError(503, "CM temporarily offline; please try again later");
} }
#
# Check for excessive load
#
if ($MAINSITE) {
my $uptime = `uptime`;
if ($uptime =~ /load averages:\s+([\.\d]+),\s+([\.\d]+),\s+[\.\d]+/) {
if ($1 > 10.0) {
sleep(10);
XMLError(503, "Server is WAY too busy; please try again later");
}
}
}
# #
# Sanity check. # Sanity check.
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment