I've been seeing many instances lately of my machine switching to Ultra,
then about an hour or so later begin demoted to leaf. In "Preferences"
"GnutellaNet", the reported reason is always "Sufficient Bandwidth: No". I
*know* that I'm not short of bandwidth!
After adding some debugging statements to the code, I've verified that this
is a "false positive" situation.
======================================
>From src/core/bsched.c:2485
if (ul_running && bws_out_ema < BW_OUT_UP_MIN)
return FALSE; /* 1. */
======================================
ul_running = "Am I running as an Ultrapeer?" (boolean)
bws_out_ema = Output bandwidth used for Gnet traffic (I *think* this is in
Kbits/sec - not really sure)
BW_OUT_UP_MIN = 8192
Basically, this is saying "If the amount of bandwidth used for outgoing Gnet
connections is less than 8192, then there isn't enough available bandwidth -
switch to leaf".
I believe the purpose of this is to detect "bandwidth starvation" - If
there's some other process that's using up so much of the node's bandwidth
that there isn't enough left for Gnet, then GtkG *should* be demoted (to
reduce negative impact on Gnet).
However, in the situations I've been seeing, there is no other process. On
several occasions, I've had GtkG demoted even though there's NOTHING else on
the computer using the network (just shells, XMMS, etc.).
What is happening is that my node is simply not generating enough output
data to meet that requirement (slow night or something). If Gnet traffic
hits a slow spot, then there is a false positive on this test.
My suggestion for a fix: Instead of using a single instance to determine if
we're bandwidth starved, have it keep a counter of times that this test has
failed, and only trigger the demotion if the test fails a certain number of
times in a row:
if (ul_running && bws_out_ema < BW_OUT_UP_MIN) {
if (bandwidth_low_counter++ > 5}
return FALSE;
} else
bandwidth_low_counter = 0;
Any comments? Am I misunderstanding how "bws_out_ema" works and what this
test is for?
Lloyd Bryant
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gtk-gnutella-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel