<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 7, 2023 at 4:07 PM David Fifield <<a href="mailto:david@bamsoftware.com">david@bamsoftware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Linus Nordberg and I are preparing a submission for FOCI about the<br>
special way we run tor on the Snowflake bridge. We run many tor<br>
processes with the same identity and onion keys, because otherwise tor<br>
being limited to one CPU would be the main bottleneck.<br>
<br>
I'm writing to fact-check a claim about Arti and how we hope the current<br>
complicated procedure will not be needed in the future:<br>
<br>
        The first and most important bottleneck to overcome is the<br>
        single-threaded nature of the Tor implementation.² A single Tor<br>
        process is limited to one CPU core: once Tor hits 100% CPU, the<br>
        performance of the bridge is capped, no matter the speed of the<br>
        network connection or the number of CPU cores<br>
<br>
        ²We expect that Arti, the in-progress reimplementation of Tor,<br>
        will be natively multi-threaded, and remove this primary<br>
        complication.<br>
<br>
Is this correct? Is a relay that uses a future version of Arti expected<br>
to be able to use all its CPU resources?<br>
<br></blockquote><div><br></div><div>Yes, that's right.  There is no "main thread" in Arti; it's written in an asynchronous task-oriented style, and we use a runtime written in Rust (Tokio by default, but we abstract them so you can swap them out) to schedule tasks across multiple threads.</div><div><br></div><div>That said, we have spent approximately zero time so far tuning this multithreading, and I'd be surprised if it scales perfectly the first time.  Our first opportunity to show off here will be when we get onion service support later in this year.</div><div><br></div><div>cheers,</div><div>-- <br></div><div>Nick<br></div></div></div>