net.i2p.router
Class LoadTestManager

java.lang.Object
  extended by net.i2p.router.LoadTestManager

public class LoadTestManager
extends java.lang.Object

Coordinate some tests of peers to see how much load they can handle. If TEST_LIVE_TUNNELS is set to false, it builds load test tunnels across various peers in ways that are not anonymity sensitive (but may help with testing the net). If it is set to true, however, it runs a few tests at a time for actual tunnels that are built, to help determine whether our peer selection is insufficient. Load tests of fake tunnels are conducted by building a single one hop inbound tunnel with the peer in question acting as the inbound gateway. We then send messages directly to that gateway, which they batch up and send "down the tunnel" (aka directly to us), at which point we then send another message, and so on, until the tunnel expires. Along the way, we record a few vital stats to the "loadtest.log" file. If we don't receive a message, we send another after 10 seconds. If "router.loadTestSmall=true", we transmit a tiny DeliveryStatusMessage (~96 bytes at the SSU level), which is sent back to us as a single TunnelDataMessage (~1KB). Otherwise, we transmit a 4KB DataMessage wrapped inside a garlic message, which is sent back to us as five (1KB) TunnelDataMessages. This size is chosen because the streaming lib uses 4KB messages by default. Load tests of live tunnels pick a random tunnel from the tested pool's pair (e.g. if we are testing an outbound tunnel for a particular destination, it picks an inbound tunnel from that destination's inbound pool), with each message going down that one randomly paired tunnel for the duration of the load test (varying the paired tunnel with each message had poor results)


Field Summary
static boolean TEST_LIVE_TUNNELS
           
 
Constructor Summary
LoadTestManager(RouterContext ctx)
           
 
Method Summary
 void addTunnelTestCandidate(TunnelCreatorConfig cfg)
          If we are testing live tunnels, see if we want to test the one that was just created fully.
static boolean isEnabled(I2PAppContext ctx)
           
 void removeTunnelTestCandidate(TunnelCreatorConfig cfg)
           
static void setEnableLoadTesting(RouterContext ctx, boolean enable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_LIVE_TUNNELS

public static final boolean TEST_LIVE_TUNNELS
See Also:
Constant Field Values
Constructor Detail

LoadTestManager

public LoadTestManager(RouterContext ctx)
Method Detail

isEnabled

public static boolean isEnabled(I2PAppContext ctx)

setEnableLoadTesting

public static void setEnableLoadTesting(RouterContext ctx,
                                        boolean enable)

addTunnelTestCandidate

public void addTunnelTestCandidate(TunnelCreatorConfig cfg)
If we are testing live tunnels, see if we want to test the one that was just created fully.


removeTunnelTestCandidate

public void removeTunnelTestCandidate(TunnelCreatorConfig cfg)