Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #4518

Closed (moved)
(moved)
Open
Created Nov 19, 2011 by Nick Mathewson@nickm🍬

assign_onionskin_to_cpuworker is too expensive

The function "assign_onionskin_to_cpuworker()" is 20% of CPU usage on Moritz's profile. If that's so, the likeliest culprit is one of the functions getting inlined there: probably cull_wedged_cpuworkers, which does a linear walk over all the connections.

(I'm guessing that connection_get_by_type_state, which also does a linear walk over all the connections, doesn't show up in the profile because, on a busy server, the average cpuworker is always busy, so assign_onionskin_to_cpuworker mostly gets called from cpuworker.c to assign an onionskin to a cpuworker that just became idle.)

The easiest fix for this would be to only call cull_wedged_cpuworkers every N seconds, or every N invocations of assign_onionskin_to_cpuworker(). This is easy enough that I'm marking this one for 0.2.2

If connection_get_by_type_state shows up in profiles, we can look into another data structure on connections.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking