[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #22798 [Core Tor/Tor]: Windows relay is several times slower than Linux relay



#22798: Windows relay is several times slower than Linux relay
-------------------------------------------------+-------------------------
 Reporter:  Vort                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.3.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.9.11
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-relay, performance, windows,     |  Actual Points:
  review-group-29                                |
Parent ID:                                       |         Points:  5
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by Vort):

 * status:  needs_revision => needs_review


Comment:

 To make unencrypted upload testable, I have added fake command to control
 port protocol:
 {{{#!c
 } else if (!strcasecmp(conn->incoming_cmd, "AAA")) {
   int testchunksz = 4096;
   char* trb = malloc(testchunksz + 1);
   memset(trb, '0', testchunksz);
   trb[testchunksz] = '\0';
   for (int i = 0; i < 256; i++)
     connection_write_str_to_buf(trb, conn);
   connection_write_str_to_buf("\r\n", conn);
   free(trb);
 }}}
 Then executed test program from Ubuntu VM:
 {{{#!csharp
 static void Main(string[] args)
 {
     int testdatasz = 4096 * 256;

     TcpClient tc = new TcpClient();
     tc.Connect(args[0], int.Parse(args[1]));
     NetworkStream networkStream = tc.GetStream();
     var br = new BinaryReader(networkStream);
     var bw = new BinaryWriter(networkStream);
     bw.Write(Encoding.UTF8.GetBytes("AAA\n"));
     var sw = new Stopwatch();
     sw.Start();
     var a = br.ReadBytes(testdatasz);
     sw.Stop();
     var b = br.ReadBytes(2);
     if (b[1] != 10)
         throw new Exception();
     Console.WriteLine($"Bandwidth = {(int)(testdatasz / 1024.0 /
 sw.Elapsed.TotalSeconds)} KiB/s");
 }
 }}}
 With 10 Mbit / 150 ms connection, adding of `update_send_buffer_size()`
 call changes output from 77 KiB/s to 578 KiB/s.
 Strange thing is that such change does not allow to use full bandwidth of
 1220 KiB/s.
 But, anyway, it is better than nothing.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22798#comment:134>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs