Freenet新月支部

a2a9fc36 anonymous 2012-10-08 11:56
--- freenet/node/useralerts/PeerManagerUserAlert.java   Tue Jan 20 07:26:36 1970
+++ freenet/node/useralerts/PeerManagerUserAlert.java   Tue Jan 20 07:26:36 1970
@@ -40,7 +40,7 @@
        public static final int MIN_CONN_ALERT_THRESHOLD = 3;
        
        /** How many connected peers we can have without getting alerted about too many */
-       public static final int MAX_CONN_ALERT_THRESHOLD = 40;
+       public static final int MAX_CONN_ALERT_THRESHOLD = 200;
        
        /** How many disconnected peers we can have without getting alerted about too many */
        public static final int MAX_DISCONN_PEER_ALERT_THRESHOLD = 50;
@@ -55,7 +55,7 @@
        public static final int MIN_CONN_ERROR_ALERT_THRESHOLD = 5;
        
        /** How many peers we can have without getting alerted about too many */
-       public static final int MAX_PEER_ALERT_THRESHOLD = 100;
+       public static final int MAX_PEER_ALERT_THRESHOLD = 250;
        
        /** How high can oldestNeverConnectedPeerAge be before we alert (in milliseconds)*/
        public static final long MAX_OLDEST_NEVER_CONNECTED_PEER_AGE_ALERT_THRESHOLD = ((long) 2)*7*24*60*60*1000;  // 2 weeks
--- freenet/node/LocationManager.java   Tue Jan 20 07:26:36 1970
+++ freenet/node/LocationManager.java   Tue Jan 20 07:26:36 1970
@@ -648,7 +648,7 @@
     }
 
     private void announceLocChange(boolean log, boolean randomReset, boolean fromDupLocation) {
-        Message msg = DMT.createFNPLocChangeNotificationNew(getLocation(), node.peers.getPeerLocationDoubles(true));
+       Message msg = DMT.createFNPLocChangeNotificationNew(getLocation(), node.peers.getMaxPeerLocationDoubles(true));
         node.peers.localBroadcast(msg, false, true, this);
        if(log)
                recordLocChange(randomReset, fromDupLocation);
--- freenet/node/OpennetManager.java    Tue Jan 20 07:26:36 1970
+++ freenet/node/OpennetManager.java    Tue Jan 20 07:26:36 1970
@@ -134,11 +134,12 @@
        /** Constant for scaling peers: we multiply bandwidth in kB/sec by this
         * and then take the square root. 12 gives 11 at 10K, 15 at 20K, 19 at
         * 30K, 26 at 60K, 34 at 100K, 40 at 140K. */
-       public static final double SCALING_CONSTANT = 12.0;
+       public static final double SCALING_CONSTANT = 20.0;
        /** Minimum number of peers */
        public static final int MIN_PEERS_FOR_SCALING = 10;
        /** Maximum number of peers. */
-       public static final int MAX_PEERS_FOR_SCALING = 40;
+       public static final int MAX_PEERS_FOR_SCALING = 200;
+       public static final int OLD_MAX_PEERS_FOR_SCALING = 40;
        /** Maximum number of peers for purposes of FOAF attack/sanity check */
        public static final int PANIC_MAX_PEERS = 50;
        /** Stop trying to reconnect to an old-opennet-peer after a month. */
--- freenet/node/PeerManager.java       Tue Jan 20 07:26:36 1970
+++ freenet/node/PeerManager.java       Tue Jan 20 07:26:36 1970
@@ -778,6 +778,20 @@
                        return locs;
        }
 
+       public double[] getMaxPeerLocationDoubles(boolean pruneBackedOffPeers) {
+               double[] locs=getPeerLocationDoubles(pruneBackedOffPeers);
+               if(locs.length>OpennetManager.OLD_MAX_PEERS_FOR_SCALING)
+               {
+                       double[] newLocs = new double[OpennetManager.OLD_MAX_PEERS_FOR_SCALING];
+                       System.arraycopy(locs, 0, newLocs, 0, OpennetManager.OLD_MAX_PEERS_FOR_SCALING);
+                       return newLocs;
+               }
+               else
+               {
+                       return locs;
+               }
+       }
+
        /** Just like getPeerLocationDoubles, except it also
         * returns the UID for each node. */
        public LocationUIDPair[] getPeerLocationsAndUIDs() {
--- freenet/node/PeerNode.java  Tue Jan 20 07:26:36 1970
+++ freenet/node/PeerNode.java  Tue Jan 20 07:26:36 1970
@@ -2396,7 +2396,7 @@
        protected void sendInitialMessages() {
                loadSender(true).setSendASAP();
                loadSender(false).setSendASAP();
-               Message locMsg = DMT.createFNPLocChangeNotificationNew(node.lm.getLocation(), node.peers.getPeerLocationDoubles(true));
+               Message locMsg = DMT.createFNPLocChangeNotificationNew(node.lm.getLocation(), node.peers.getMaxPeerLocationDoubles(true));
                Message ipMsg = DMT.createFNPDetectedIPAddress(detectedPeer);
                Message timeMsg = DMT.createFNPTime(System.currentTimeMillis());
                Message packetsMsg = createSentPacketsMessage();
--- freenet/node/RequestStarter.java    Tue Jan 20 07:26:36 1970
+++ freenet/node/RequestStarter.java    Tue Jan 20 07:26:36 1970
@@ -77,6 +77,9 @@
        private final boolean isInsert;
        private final boolean isSSK;
        final boolean realTime;
+       private long lastDelay;
+       private final long a, b, c;
+
        
        static final int MAX_WAITING_FOR_SLOTS = 50;
        
@@ -93,6 +96,10 @@
                this.isInsert = isInsert;
                this.isSSK = isSSK;
                this.realTime = realTime;
+               this.lastDelay = 4000; // start slowly
+               this.a = 7;
+               this.b = 2;
+               this.c = 1;
        }
 
        void setScheduler(RequestScheduler sched) {
@@ -139,7 +146,8 @@
                                if(!req.localRequestOnly) {
                                        // Wait
                                        long delay;
-                                       delay = throttle.getDelay();
+                                       delay = (a*100 + b*this.lastDelay + c*throttle.getDelay()) / (a + b + c);
+                                       this.lastDelay = delay;
                                        if(logMINOR) Logger.minor(this, "Delay="+delay+" from "+throttle);
                                        long sleepUntil = cycleTime + delay;
                                        if(!LOCAL_REQUESTS_COMPETE_FAIRLY) {

----- Anonymous ----- 2012.10.07 - 14:13:07GMT -----

MaxpeerとRequestStarterのパッチ当てでメモリー馬鹿食いだけど1000blocks/min以上って出るんだな。
170peer、Realtime併用で瞬間1300blocks/minとか初めて見た

Top of this page. | <<last 0 1 2 3 4 5 6 7 8 9

limit: 15360KB

(Freenet新月支部/970/2.6MB)


Powered by shinGETsu.