Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3196 closed defect (fixed)

Tor client finishes bootstrapping too early

Reported by: arma Owned by:
Priority: High Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: performance bootstrap tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Right now we start building circuits once we have 25% of the relay descriptors we'll want. The goal is to reach the 100% bootstrapped mark asap so the user doesn't have to wait.

But once we do that, for the next little while Tor has really horrible performance, since it's fetching dir info in parallel to whatever the user is trying to do.

This problem is especially noticeable in TBB, since it launches a Firefox and makes a new stream as soon as it's bootstrapped. That stream takes way longer than it 'should', and it's our user's first view of Tor performance. (But see also #3195, which would get worse if we delay bootstrap success.)

Once upon a time, when all Tor clients were on fast links and when the directory was small, there wasn't much harm in declaring bootstrap success early. You were nearly done anyway, and clients on fast links can handle doing two things at once.

But if you're on a fast link, you'll finish the rest of your bootstrapping pretty quickly anyway. And if you're on a slow link, we're cheating you by telling you you're all ready when you're not.

I think we should delay the 100% bootstrap mark until we have more of the descriptors we'll want -- I'm thinking between 75% and 100%. (We could still begin circuit attempts at the 25% mark, so circuit building happens in parallel to descriptor fetching.)

Child Tickets

Change History (8)

comment:1 Changed 8 years ago by nickm

The main reason I hit premature bootstrapping these days is that Tor has enough cached info to build circuits and starts doing so while still replacing its consensus networkstatus. It finishes a circuit, and declares itself bootstrapped... but as soon as it gets a new networkstatus, it drops a lot of descriptors, declares them obsolete, and decides it can't build circuits.

comment:2 Changed 8 years ago by nickm

(oh, nm. That's #2878.)

comment:3 Changed 7 years ago by arma

Keywords: performance bootstrap added

comment:4 Changed 7 years ago by nickm

Status: newneeds_review

See branch bug3196 in my public repo.

comment:5 Changed 7 years ago by arma

Patch looks like it would work. On the other hand, it also delays bootstrapping. I wonder how much we're giving up by delaying the circuitbuilding? I've opened #5966 for that question, and it shouldn't happen in the 0.2.3 timeframe.

comment:6 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged bug3196 branch, closing.

comment:7 Changed 7 years ago by nickm

Keywords: tor-client added

comment:8 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.