NumCPUs for the tor process #59
Replies: 4 comments
-
Hi, To deal with current attacks I recommend a minimum of 16 and that depends on the traffic you're relaying. I have mine around 24-30. Even though your system has 4 CPUs you can safely and easily set it to 16 or more. It's not like overclocking and it won't put much pressure on your CPU. |
Beta Was this translation helpful? Give feedback.
-
By the way, I suggest you start from a certain number and look at how you're dealing with the traffic and whether you show up as overloaded. Then gradually increase the number until you find that magic number. I use htop to look at the worker threads during high loads and when I see a couple of them using 0% I know I have enough. By the way, each time you change the number you have to restart Tor for it to take effect. A -HUP signal won't do. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I have put 16 processes to see how it goes. Its currently using 2% of CPU for each process (with htop) and main process uses 112% |
Beta Was this translation helpful? Give feedback.
-
Yes. Tor doesn't understand multiple CPUs so it combines everything and reports it under one CPU. The 112% is actually the combination of all those worker threads plus the main process. So it's actually using 1.12 CPUs out of 4 (or 8 if your processor is multi threaded) |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I would like to know what is the best option to set for NumCPUs to optimize tor on my servers.
Im having an old (slow but enough to make a guard relay) desktop PC running with 4 cores, 4 GB RAM. How many NumCPUs should I put for this server ?
When looking nyx, its always between 100 and 125% of CPU usage which isn't good for overload status.
I also have many small servers running with only one core and 1 GB RAM for bridges, how many NumCPUs should I put for them ?
Thanks for your help 😄
Beta Was this translation helpful? Give feedback.
All reactions