Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #25373

Closed (moved)
Open
Opened Feb 27, 2018 by Nick Mathewson@nickm🐙

Avoid needless wakeups for token bucket refills.

In 0.2.3.5-alpha, we increased our default token bucket refill interval from 1 time per second to 10 times per second. (See #3630 (moved) and proposal 183.)

AFAICT, this is now the most frequently running timer causing wakeups on an idle Tor instance. It even causes wakeups on Tor instances when DisableNetwork is set. We can do better!

Two key insights:

  • First, it is not necessary to actually refill these buckets periodically. Instead, we can store the last time at which we refilled each one, and calculate its current size at immediately before we read or write. The only thing we'll need to use a timer for is to wake up connections on which we've stopped reading or writing.

  • Second, we only need to have this timer active when at least one connection is blocked on bandwidth.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.3.4.x-final
Milestone
Tor: 0.3.4.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#25373