Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 320
    • Issues 320
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 37
    • Merge requests 37
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #8002
Closed
Open
Created Jan 19, 2013 by Trac@tracbot

Mis-count of CPUs

On start-up Tor v0.2.3.25/Linux says:

"[notice] Wow! I detected that you have 64 CPUs. I will not autodetect any more than 16, though. If you want to configure more, set NumCPUs in your torrc"

This is in a CentOS6/OpenVZ VPS with only a single virtual CPU. Tor config param NumCPUs is not used.

It turns out that OpenVZ, since version rhel6/042stab061.2, lists all the host CPUs in /sys/devices/system/cpu/. It is this number of processors that is returned by the sysconf(_SC_NPROCESSORS_CONF) that Tor uses in ~/tor-0.2.3.25/src/common/compat.c to determine CPU count.

From the command line:

getconf _NPROCESSORS_ONLN

1

Programmatically:

$ /tmp/main sysconf() says: 64 Wow, too many CPUs: 64

I know that there's not much you can do about a sysconf() that lies. I want to get this on the record, though, for the sake of Tor's future auto-scaling.

Trac:
Username: tmpname0901

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