[tor-bugs] #12464 [Tor]: When Tor 0.2.6.x is closer to done, profile relays running Tor 0.2.6.x and optimize accordingly

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Feb 11 20:53:45 UTC 2015


#12464: When Tor 0.2.6.x is closer to done, profile relays running Tor 0.2.6.x and
optimize accordingly
------------------------+-------------------------------------------------
     Reporter:  nickm   |      Owner:  dgoulet
         Type:  defect  |     Status:  assigned
     Priority:  normal  |  Milestone:  Tor: 0.2.6.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  tor-relay performance 026-triaged-1
Actual Points:          |  Parent ID:
       Points:          |
------------------------+-------------------------------------------------

Comment (by dgoulet):

 Latest profiling at commit 99e915dbfea9b2b985a10368721d9c79b358abbe

 {{{
 +  15.86%  tor  [.] fmonty
 +   3.79%  tor  [.] circuitmux_find_map_entry
 +   2.81%  tor  [.] connection_bucket_refill
 +   2.57%  tor  [.] connection_handle_read_impl
 +   1.99%  tor  [.] buf_datalen
 +   1.79%  tor  [.] assert_connection_ok
 +   1.52%  tor  [.] connection_or_process_cells_from_inbuf
 }}}

 I can see a couple of way of reducing {{{circuitmux_find_map_entry()}}}
 cpu time by calling it less. For instance, {{{update_circuit_on_cmux_}}}
 calls it 3 times in the same function querying the same cmux,circ pair.

 Clearly biggest part of the CPU is crypto. Here is an other view without a
 procname "tor" filter. First value of 37.04% is kernel work.

 {{{
 +  37.04%  tor  [ctr]                  [k] 0xffffffff8104f45a
 +   3.85%  tor  tor                    [.] fmonty
 +   2.85%  tor  libcrypto.so.1.0.0     [.] gcm_ghash_clmul
 +   2.82%  tor  libcrypto.so.1.0.0     [.] aesni_ctr32_encrypt_blocks
 +   2.14%  tor  libcrypto.so.1.0.0     [.] aesni_cbc_sha1_enc_avx
 +   2.01%  tor  libcrypto.so.1.0.0     [.] bn_sqr4x_mont
 +   1.62%  tor  libc-2.19.so           [.] _int_malloc
 +   1.60%  tor  libcrypto.so.1.0.0     [.] sha1_block_data_order_avx
 +   1.04%  tor  libc-2.19.so           [.] __memcpy_sse2_unaligned
 +   0.95%  tor  libevent-2.0.so.5.1.9  [.] event_base_loop
 +   0.95%  tor  libz.so.1.2.8          [.] 0x0000000000002a87
 +   0.92%  tor  tor                    [.] circuitmux_find_map_entry
 }}}

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


More information about the tor-bugs mailing list