Try to alleviate connection-limit network collapse:

* Transport:
      - Lower min NTCP idle time to 3m (was 5m)
      - Increase SSU conn limit by 33%
    * Watchdog:
      - Defang him again
This commit is contained in:
zzz
2009-06-06 15:14:05 +00:00
parent 7e651d53a0
commit 4c4b3b776c
3 changed files with 8 additions and 4 deletions

View File

@ -49,8 +49,8 @@ class RouterWatchdog implements Runnable {
} }
private boolean shutdownOnHang() { private boolean shutdownOnHang() {
// prop default true // prop default false
if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang", "true")).booleanValue()) if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang")).booleanValue())
return false; return false;
// Client manager starts complaining after 10 minutes, and we run every minute, // Client manager starts complaining after 10 minutes, and we run every minute,
@ -94,7 +94,7 @@ class RouterWatchdog implements Runnable {
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
_log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max)); _log.error("Memory: " + DataHelper.formatSize(used) + '/' + DataHelper.formatSize(max));
if (_consecutiveErrors == 1) { if (_consecutiveErrors == 1) {
_log.log(Log.CRIT, "Router appears hung! Will restart in 20 minutes if it doesn't fix itself"); _log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!");
// This might work on linux... // This might work on linux...
// It won't on windows, and we can't call i2prouter.bat either, it does something // It won't on windows, and we can't call i2prouter.bat either, it does something
// completely different... // completely different...

View File

@ -106,6 +106,9 @@ public abstract class TransportImpl implements Transport {
! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled()) ! ((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled())
def = MAX_CONNECTION_FACTOR * (1 + bw - Router.CAPABILITY_BW12); def = MAX_CONNECTION_FACTOR * (1 + bw - Router.CAPABILITY_BW12);
} }
// increase limit for SSU, for now
if (style.equals("udp"))
def = def * 4 / 3;
return _context.getProperty("i2np." + style + ".maxConnections", def); return _context.getProperty("i2np." + style + ".maxConnections", def);
} }

View File

@ -51,7 +51,8 @@ public class EventPumper implements Runnable {
* the time to iterate across them to check a few flags shouldn't be a problem. * the time to iterate across them to check a few flags shouldn't be a problem.
*/ */
private static final long FAILSAFE_ITERATION_FREQ = 2*1000l; private static final long FAILSAFE_ITERATION_FREQ = 2*1000l;
private static final long MIN_EXPIRE_IDLE_TIME = 5*60*1000l; /** tunnel test is every 30-60s, so this should be longer than, say, 3*45s to allow for drops */
private static final long MIN_EXPIRE_IDLE_TIME = 3*60*1000l;
private static final long MAX_EXPIRE_IDLE_TIME = 15*60*1000l; private static final long MAX_EXPIRE_IDLE_TIME = 15*60*1000l;
public EventPumper(RouterContext ctx, NTCPTransport transport) { public EventPumper(RouterContext ctx, NTCPTransport transport) {