scheduler: allow to configure userids for which the scheduler should

not scan the host table. This was previously hardcoded for
  Einstein@home to prevent some users with many (identical) hosts
  from flooding the DB with slow queries. Now add
  <dont_search_host_for_userid>userid</dont_search_host_for_userid>
  to the project config (in config.xml) for each such userid.

svn path=/trunk/boinc/; revision=25346
This commit is contained in:
Bernd Machenschalk 2012-02-27 12:08:25 +00:00
parent df439c128b
commit 5bb86f79b8
4 changed files with 23 additions and 5 deletions

View File

@ -2226,3 +2226,16 @@ Bernd 27 feb 2012
sched/
validator.cpp
Bernd 27 feb 2012
- scheduler: allow to configure userids for which the scheduler should
not scan the host table. This was previously hardcoded for
Einstein@home to prevent some users with many (identical) hosts
from flooding the DB with slow queries. Now add
<dont_search_host_for_userid>userid</dont_search_host_for_userid>
to the project config (in config.xml) for each such userid.
sched/
sched_config.h
sched_config.cpp
handle_request.cpp

View File

@ -68,11 +68,11 @@ static bool find_host_by_other(DB_USER& user, HOST req_host, DB_HOST& host) {
char buf[2048];
char dn[512], ip[512], os[512], pm[512];
#ifdef EINSTEIN_AT_HOME
// This is to prevent GRID hosts that manipulate their hostids from flooding E@H's DB with slow queries
if ((user.id == 282952) || (user.id == 243543))
return false;
#endif
// don't dig through hosts of these users
// prevents flooding the DB with slow queries from users with many hosts
for(unsigned int i=0; i < config.dont_search_host_for_userid.size(); i++)
if (user.id == config.dont_search_host_for_userid[i])
return false;
// Only check if the fields are populated
if (strlen(req_host.domain_name) && strlen(req_host.last_ip_addr) && strlen(req_host.os_name) && strlen(req_host.p_model)) {

View File

@ -199,6 +199,10 @@ int SCHED_CONFIG::parse(FILE* f) {
}
continue;
}
if (xp.parse_int(tag, "dont_search_host_for_user", retval)) {
dont_search_host_for_userid.push_back(retval);
continue;
}
if (xp.parse_int("daily_result_quota", daily_result_quota)) continue;
if (xp.parse_double("default_disk_max_used_gb", default_disk_max_used_gb)) continue;
if (xp.parse_double("default_disk_max_used_pct", default_disk_max_used_pct)) continue;

View File

@ -104,6 +104,7 @@ struct SCHED_CONFIG {
vector<regex_t> *ban_cpu;
vector<regex_t> *ban_os;
vector<int> dont_search_host_for_userid;
int daily_result_quota; // max results per day is this * mult
double default_disk_max_used_gb;
double default_disk_max_used_pct;