Author: toad
Date: 2008-03-11 14:56:06 +0000 (Tue, 11 Mar 2008)
New Revision: 18456

Modified:
   trunk/freenet/src/freenet/node/Node.java
Log:
Tune the BDBJE's maximum latency using the je.env.background* options.
We were having long pauses on the UDP handler thread caused by the whole 
datastore being blocked for >10 seconds.

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2008-03-11 14:53:36 UTC (rev 
18455)
+++ trunk/freenet/src/freenet/node/Node.java    2008-03-11 14:56:06 UTC (rev 
18456)
@@ -1286,9 +1286,16 @@
                envConfig.setLockTimeout(600*1000*1000); // should be long 
enough even for severely overloaded nodes!
                // Note that the above is in *MICRO*seconds.
                envConfig.setConfigParam("je.log.faultReadSize", "6144");
+               // 
http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#35
                envConfig.setConfigParam("je.evictor.lruOnly", "false");  //Is 
not a mutable config option and must be set before opening of environment.
                envConfig.setConfigParam("je.evictor.nodesPerScan", "100");  
//Is not a mutable config option and must be set before opening of environment.
+               // FIXME consider reducing nodesPerScan to reduce maximum 
latency. It's a tradeoff between eviction scan accuracy and maximum latency 
cost.

+               // Tune latency
+               envConfig.setConfigParam("je.env.backgroundReadLimit", "65536");
+               envConfig.setConfigParam("je.env.backgroundWriteLimit", 
"65536");
+               envConfig.setConfigParam("je.env.backgroundSleepInterval", 
"10000" /* microseconds */); // 10ms
+               
                File dbDir = new File(storeDir, 
"database-"+getDarknetPortNumber());
                dbDir.mkdirs();



Reply via email to