Changeset a3108ea


Ignore:
Timestamp:
Sep 6, 2008 1:48:25 PM (13 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
536f5d0
Parents:
808557d
Message:
  • Throttle: Combine current and last bw measurement, reduce default max tunnels to 2500 (was 3000)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    r808557d ra3108ea  
    3232   
    3333    private static final String PROP_MAX_TUNNELS = "router.maxParticipatingTunnels";
    34     private static final String DEFAULT_MAX_TUNNELS = "3000";  // Unless share BW > 300KBps, BW limit will kick in first
     34    private static final String DEFAULT_MAX_TUNNELS = "2500";  // Unless share BW > 250KBps, BW limit will kick in first
    3535    private static final String PROP_DEFAULT_KBPS_THROTTLE = "router.defaultKBpsThrottle";
    3636
     
    214214            r = rs.getRate(10*60*1000);
    215215            if (r != null) {
    216                 if (r.getLastEventCount() > 0)
    217                     messagesPerTunnel = r.getAverageValue();
     216                long count = r.getLastEventCount() + r.getCurrentEventCount();
     217                if (count > 0)
     218                    messagesPerTunnel = (r.getLastTotalValue() + r.getCurrentTotalValue()) / count;
    218219                else
    219220                    messagesPerTunnel = r.getLifetimeAverageValue();
Note: See TracChangeset for help on using the changeset viewer.