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

[tor-bugs] #1706 [Tor - Metrics]: Calculate fraction of bytes spent on answering directory requests



#1706: Calculate fraction of bytes spent on answering directory requests
---------------------------+------------------------------------------------
 Reporter:  karsten        |       Owner:  Karsten
     Type:  enhancement    |      Status:  new    
 Priority:  normal         |   Milestone:         
Component:  Tor - Metrics  |     Version:         
 Keywords:                 |      Parent:         
---------------------------+------------------------------------------------
 I'm using the following patch to distinguish Directory traffic from OR
 traffic on my test relay:

 diff --git a/src/or/connection.c b/src/or/connection.c
 index 7b1493b..9eeed63 100644
 --- a/src/or/connection.c
 +++ b/src/or/connection.c
 @@ -2075,11 +2075,17 @@ connection_buckets_decrement(connection_t *conn,
 time_t n
      if (conn->type == CONN_TYPE_EXIT)
        rep_hist_note_exit_bytes_read(conn->port, num_read);
      rep_hist_note_bytes_read(num_read, now);
 +    log_info(LD_DIR, "Read %d bytes from %s connection " U64_FORMAT ".",
 +             num_read, conn_type_to_string(conn->type),
 +             U64_PRINTF_ARG(conn->global_identifier));
    }
    if (num_written > 0) {
      if (conn->type == CONN_TYPE_EXIT)
        rep_hist_note_exit_bytes_written(conn->port, num_written);
      rep_hist_note_bytes_written(num_written, now);
 +    log_info(LD_DIR, "Wrote %d bytes to %s connection " U64_FORMAT ".",
 +             num_written, conn_type_to_string(conn->type),
 +             U64_PRINTF_ARG(conn->global_identifier));
    }

    if (connection_counts_as_relayed_traffic(conn, now)) {

 As a result, I get a very low fraction of Directory traffic compared to OR
 traffic. I wonder why that is the case.

 In the attachment you can find a histogram of 10-second intervals and the
 sum of read and written bytes in KiB/s. There are only very few Directory
 connections with very little bandwidth consumption in that histogram. This
 is a 500 KiB/s middle node running for 24 hours.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1706>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online