Commit 0126a71d authored by Mike Hibler's avatar Mike Hibler

Sort out issues w.r.t. unlimited bandwidth and dynamic bandwidth.

Setting bandwidth==0 in either the sitevars or via subboss_attributes
will now get properly translated to no bandwidth cap in frisbeed.
Previously it was ignored. But I still do not recommend this setting
as slow clients can get swamped.

Allow setting of dynamic BW control along with unlimited bandwidth.
Likewise not recommended (though marginally better than the above).
parent 4ac640c7
......@@ -247,8 +247,8 @@ emulab_read(void)
get_maxrate_std = (uint32_t)ival;
free(val);
}
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_std = N/A");
if (get_maxrate_std == 0)
FrisLog(" image_get_maxrate_std = unlimited");
else
FrisLog(" image_get_maxrate_std = %d Mbit/sec",
(int)(get_maxrate_std/1000000));
......@@ -261,8 +261,8 @@ emulab_read(void)
get_maxrate_usr = (uint32_t)ival;
free(val);
}
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_usr = N/A");
if (get_maxrate_usr == 0)
FrisLog(" image_get_maxrate_usr = unlimited");
else
FrisLog(" image_get_maxrate_usr = %d Mbit/sec",
(int)(get_maxrate_usr/1000000));
......@@ -336,14 +336,14 @@ emulab_restore(void *state)
FrisLog(" image_get_maxrate_dyn = %s",
get_maxrate_dyn ? "true" : "false");
get_maxrate_std = cs->image_maxrate_std;
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_std = N/A");
if (get_maxrate_std == 0)
FrisLog(" image_get_maxrate_std = unlimited");
else
FrisLog(" image_get_maxrate_std = %d Mbit/sec",
(int)(get_maxrate_std/1000000));
get_maxrate_usr = cs->image_maxrate_usr;
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_usr = N/A");
if (get_maxrate_usr == 0)
FrisLog(" image_get_maxrate_usr = unlimited");
else
FrisLog(" image_get_maxrate_usr = %d Mbit/sec",
(int)(get_maxrate_usr/1000000));
......@@ -387,6 +387,7 @@ set_get_values(struct config_host_authinfo *ai, int ix)
{
struct config_imageinfo *ii = &ai->imageinfo[ix];
char str[256];
int maxrate;
/* get_methods */
ii->get_methods = CONFIG_IMAGE_MCAST;
......@@ -418,13 +419,19 @@ set_get_values(struct config_host_authinfo *ai, int ix)
ii->get_timeout = 60;
/*
* get_options: for dynamic rate adjustment, we use the std/usr
* bandwidth value as the maximum bandwidth.
* get_options:
* - max std/usr rate of zero means unlimited.
* - for dynamic rate adjustment, we use the std/usr
* bandwidth value as the maximum bandwidth.
*/
snprintf(str, sizeof str, " %s-W %u",
get_maxrate_dyn ? "-D " : "",
isindir(STDIMAGEDIR, ii->path) ?
get_maxrate_std : get_maxrate_usr);
maxrate = isindir(STDIMAGEDIR, ii->path) ?
get_maxrate_std : get_maxrate_usr;
if (maxrate)
snprintf(str, sizeof str, " -W %u", maxrate);
else
snprintf(str, sizeof str, " -G 0");
if (get_maxrate_dyn)
strcat(str, " -D");
/*
* for client reporting we set the interval and the event server
......
......@@ -86,8 +86,8 @@ null_read(void)
{
/* "Reading" the config file is a no-op. Just echo settings. */
FrisLog(" dynamic bandwidth = %s", dynrate ? "true" : "false");
if (dynrate)
FrisLog(" max bandwidth = N/A");
if (maxrate == 0)
FrisLog(" max bandwidth = unlimited");
else
FrisLog(" max bandwidth = %d Mbit/sec",
(int)(maxrate/1000000));
......@@ -123,8 +123,8 @@ static int
null_restore(void *state)
{
FrisLog(" dynamic bandwidth = %s", dynrate ? "true" : "false");
if (dynrate)
FrisLog(" max bandwidth = N/A");
if (maxrate == 0)
FrisLog(" max bandwidth = unlimited");
else
FrisLog(" max bandwidth = %d Mbit/sec",
(int)(maxrate/1000000));
......@@ -182,9 +182,18 @@ set_get_values(struct config_host_authinfo *ai, int ix)
/* get_timeout */
ai->imageinfo[ix].get_timeout = maxlinger;
/* get_options */
snprintf(str, sizeof str, " %s-W %u",
dynrate ? "-D " : "", maxrate);
/*
* get_options:
* - maxrate of zero means unlimited.
* - for dynamic rate adjustment, we use the std/usr
* bandwidth value as the maximum bandwidth.
*/
if (maxrate)
snprintf(str, sizeof str, " -W %u", maxrate);
else
snprintf(str, sizeof str, " -G 0");
if (dynrate)
strcat(str, " -D");
strcat(str, " -K 15");
if (clientreport > 0) {
int len = strlen(str);
......@@ -810,6 +819,21 @@ null_init(char *opts)
* maxlinger=N Server lingers for N seconds after last req
* report=N Clients report progress every N seconds
* eventserver=host Host to sent client report events to
*
* Dependencies:
*
* If "bandwidth" is zero, max bandwidth is unlimited.
*
* "maxlinger" should be at least as long as "report" to ensure
* you don't exit between reports.
*
* If reporting is disabled, then "maxlinger" should be set higher
* (say, 3-5 minutes) to account for clients with lots of memory
* that download all the chunks well before they finish writing
* them to disk. Not critical, but you could lose client stats.
*
* If "report" is non-zero but "eventserver" is not set, reports
* are only logged to the server log.
*/
if (opts && opts[0]) {
char *opt;
......
......@@ -1672,9 +1672,17 @@ compute_sendrate(void)
int clockres, wireblocksize, minburst;
if (burstinterval == 0) {
burstsize = 1;
FrisLog("Maximum send bandwidth unlimited");
return;
if (!dynburst) {
burstsize = 1;
FrisLog("Maximum send bandwidth unlimited");
return;
}
/*
* XXX in order for dynamic rate adjustment to work, we
* have to have burstsize/rate params set. So we just pick
* a high bandwidth cap here (10Gb/sec).
*/
bandwidth = 10000000000;
}
/* clock resolution in usec */
......@@ -1734,7 +1742,7 @@ compute_sendrate(void)
#endif
}
if (burstsize * sizeof(Packet_t) > GetSockbufSize()) {
if (!dynburst && burstsize * sizeof(Packet_t) > GetSockbufSize()) {
FrisWarning("NOTE: burst size exceeds socket buffer size, "
"may drop packets");
}
......
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