I believe it's possible for a node A to request Key1 from node B
multiple times while node B is searching for it.  Key1 would be found
each time (eventually) and the resulting data transfers would be duplicated.

With a slow upload speed (capped cable) this can lead to large
SendingQueues and a SLOW freenet.  The attached patch dumps the list
of queued messages on each ConnectionHandler so we can see what exactly
it's sending.  The problem is that I don't ever see queued messages,
even if we have 800+k in the queue.  Obviously I'm doing something wrong
here.

This patch is complete crap, which is why I didn't check it in.  I'm
just trying to dump the queue and see what we're sending when there's a
large sendingQueue.  If someone can figure out what I did wrong and
send a new patch I'll run it on a number of my nodes that get high 
queue levels and see if we are indeed wasting bandwidth on duplicate
keys.  It's been proposed before and I'd like to find out one way
or the other for sure.  (If it's possible, I believe end-user usage
patterns would trigger it far more often then random key distribution
would speculate.  Reloading a page with one or more large graphics
while the first requests are still pending, for instance.)

It is activated at /servlet/nodeinfo/networkin/ocm?setLevel=2


Index: src/freenet/ConnectionHandler.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/ConnectionHandler.java,v
retrieving revision 1.143
diff -u -r1.143 ConnectionHandler.java
--- src/freenet/ConnectionHandler.java  5 Sep 2003 16:08:51 -0000       1.143
+++ src/freenet/ConnectionHandler.java  6 Sep 2003 07:11:39 -0000
@@ -3295,6 +3295,18 @@
                return super.toString()+" for "+conn+","+link;
        }
        
+       public String dumpQueue() {
+               StringBuffer buffer = new StringBuffer();
+               buffer.append("<ul>\n");
+               
+               for (Iterator iter = sendingQueue.iterator(); iter.hasNext(); ) {
+                       MessageSend ms = (MessageSend) iter.next();
+                 buffer.append("<li>" + ms.m.id + ": " + ms.m.otherFields.toString() 
+ "\n");
+               }
+               buffer.append("</ul>\n");
+               return buffer.toString();
+       }
+
        
 }
 
Index: src/freenet/OpenConnectionManager.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/OpenConnectionManager.java,v
retrieving revision 1.95
diff -u -r1.95 OpenConnectionManager.java
--- src/freenet/OpenConnectionManager.java      5 Sep 2003 16:08:51 -0000       1.95
+++ src/freenet/OpenConnectionManager.java      6 Sep 2003 07:11:39 -0000
@@ -497,6 +497,7 @@
                        
                                
                StringBuffer buffer = new StringBuffer();
+               StringBuffer messagebuffer = new StringBuffer();
                String sep = "</td><td>";
                String sepAlignRight = "</td><td align = 'right'>";
                String sepAlignCenter = "</td><td align = 'center'>";
@@ -607,6 +608,11 @@
                                        buffer.append(sepAlignRight+"-");
                                
buffer.append(sepAlignRight+format(ch.totalDataSent()+ch.totalDataReceived()).replaceAll("
 ","&nbsp;"));
                        }
+                       /* This is fucked up right here. */
+                       if (viewLevel > 1 && (ch.sendQueueSize() > 0)) {
+                               messagebuffer.append("<li>"+ch.toString() +"<br>\n" + 
ch.sendQueueSize() + "<br>\n" + ch.dumpQueue() + "\n");
+                       }
+                       /* End of screwed up section */
                        sendQueueSize += ch.sendQueueSize();
                        receiveQueueSize += ch.receiveQueueSize();
                        totalDataSent += ch.totalDataSent();
@@ -731,6 +737,8 @@
                        pw.print("<th><A 
HREF='"+req.getRequestURI()+"?setSorting="+(iSortingMode==9?"-9":"9")+"'>"+(Math.abs(iSortingMode)==9?sImgClause:"")+"
 Type</A></th>");
                pw.println(buffer.toString());
                pw.println("</table>");
+               if (viewLevel > 1)
+                       pw.println("<ul>\n" + messagebuffer.toString() + "</ul>\n");
        }
 
 

Attachment: pgp00000.pgp
Description: PGP signature

_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to