Changeset 99f8468f


Ignore:
Timestamp:
Jul 20, 2009 12:39:57 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
72a7393
Parents:
a9e8fc2
Message:
  • Stats: Increase coalesce time to 50s (was 20s) to reduce CPU use
  • Peer Profiles:
    • Increase reorganize time to 45s (was 30s) to reduce CPU use and lock contention
    • Remove some stat rates
Location:
router/java/src/net/i2p/router
Files:
4 edited

Legend:

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

    ra9e8fc2 r99f8468f  
    7676    public static final int NETWORK_ID = 2;
    7777   
     78    /** coalesce stats this often - should be a little less than one minute, so the graphs get updated */
     79    private static final int COALESCE_TIME = 50*1000;
     80
    7881    /** this puts an 'H' in your routerInfo **/
    7982    public final static String PROP_HIDDEN = "router.hiddenMode";
     
    313316        startupQueue();
    314317        //_context.jobQueue().addJob(new CoalesceStatsJob(_context));
    315         SimpleScheduler.getInstance().addPeriodicEvent(new CoalesceStatsEvent(_context), 20*1000);
     318        SimpleScheduler.getInstance().addPeriodicEvent(new CoalesceStatsEvent(_context), COALESCE_TIME);
    316319        _context.jobQueue().addJob(new UpdateRoutingKeyModifierJob(_context));
    317320        warmupCrypto();
     
    13491352        getContext().statManager().addRateData("router.memoryUsed", used, 0);
    13501353
    1351         getContext().tunnelDispatcher().updateParticipatingStats();
     1354        getContext().tunnelDispatcher().updateParticipatingStats(COALESCE_TIME);
    13521355
    13531356        getContext().statManager().coalesceStats();
  • router/java/src/net/i2p/router/peermanager/PeerManager.java

    ra9e8fc2 r99f8468f  
    6262        loadProfiles();
    6363        ////_context.jobQueue().addJob(new EvaluateProfilesJob(_context));
    64         SimpleScheduler.getInstance().addPeriodicEvent(new Reorg(), 0, 30*1000);
     64        SimpleScheduler.getInstance().addPeriodicEvent(new Reorg(), 0, 45*1000);
    6565        //_context.jobQueue().addJob(new PersistProfilesJob(_context, this));
    6666    }
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    ra9e8fc2 r99f8468f  
    109109        _persistenceHelper = new ProfilePersistenceHelper(_context);
    110110       
    111         _context.statManager().createRateStat("peer.profileSortTime", "How long the reorg takes sorting peers", "Peers", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
    112         _context.statManager().createRateStat("peer.profileCoalesceTime", "How long the reorg takes coalescing peer stats", "Peers", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
    113         _context.statManager().createRateStat("peer.profileThresholdTime", "How long the reorg takes determining the tier thresholds", "Peers", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
    114         _context.statManager().createRateStat("peer.profilePlaceTime", "How long the reorg takes placing peers in the tiers", "Peers", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
    115         _context.statManager().createRateStat("peer.profileReorgTime", "How long the reorg takes overall", "Peers", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
     111        _context.statManager().createRateStat("peer.profileSortTime", "How long the reorg takes sorting peers", "Peers", new long[] { 10*60*1000 });
     112        _context.statManager().createRateStat("peer.profileCoalesceTime", "How long the reorg takes coalescing peer stats", "Peers", new long[] { 10*60*1000 });
     113        _context.statManager().createRateStat("peer.profileThresholdTime", "How long the reorg takes determining the tier thresholds", "Peers", new long[] { 10*60*1000 });
     114        _context.statManager().createRateStat("peer.profilePlaceTime", "How long the reorg takes placing peers in the tiers", "Peers", new long[] { 10*60*1000 });
     115        _context.statManager().createRateStat("peer.profileReorgTime", "How long the reorg takes overall", "Peers", new long[] { 10*60*1000 });
    116116    }
    117117   
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    ra9e8fc2 r99f8468f  
    499499    /**
    500500     * Generate a current estimate of usage per-participating-tunnel lifetime.
    501      * The router code calls this every 20s.
     501     * The router code calls this every 'ms' millisecs.
    502502     * This is better than waiting until the tunnel expires to update the rate,
    503503     * as we want this to be current because it's an important part of
     
    506506     * and computing the average from that.
    507507     */
    508     public void updateParticipatingStats() {
     508    public void updateParticipatingStats(int ms) {
    509509        List<HopConfig> participating = listParticipatingTunnels();
    510510        int size = participating.size();
     
    528528        if (tcount > 0)
    529529            count = count * 30 / tcount;
    530         _context.statManager().addRateData("tunnel.participatingMessageCount", count, 20*1000);
    531         _context.statManager().addRateData("tunnel.participatingBandwidth", bw*1024/20, 20*1000);
    532         _context.statManager().addRateData("tunnel.participatingBandwidthOut", bwOut*1024/20, 20*1000);
     530        _context.statManager().addRateData("tunnel.participatingMessageCount", count, ms);
     531        _context.statManager().addRateData("tunnel.participatingBandwidth", bw*1024/(ms/1000), ms);
     532        _context.statManager().addRateData("tunnel.participatingBandwidthOut", bwOut*1024/(ms/1000), ms);
    533533        _context.statManager().addRateData("tunnel.participatingTunnels", size, 0);
    534534    }
Note: See TracChangeset for help on using the changeset viewer.