When I run cpuminer-multi as a normal user, the first message I get is "I go faster as root". It indeed does not appear anymore when run as root (with command sudo
)
What is made possible by being root? Is it safe?
When I run cpuminer-multi as a normal user, the first message I get is "I go faster as root". It indeed does not appear anymore when run as root (with command sudo
)
What is made possible by being root? Is it safe?
There are two operations at the operating system level that can be perform to improve performance in some cases but require the software to be run as superuser (root). This is mostly useful for a user who want to mine while using their computer intensively for other tasks (see comments by Gilles and hyc below).
Setting niceness
Niceness on Unix systems is a level of priority for a task relatively to others. It is enforced by the kernel. If priority is the same as other tasks, the access to the CPU is not optimal.
Niceness is set to 6 instead of the default 20 (the lower the niceness is, the higher the priority is)
Locking memory
If the system does not have enough RAM, part of it might be moved to the swap space when not used and then moved again to RAM when needed. This cause CPU time to be spoiled.
The system call [mlock][3]
allows to lock a variable in RAM.
Variable persistentctx
(of type cryptonight_ctx
) contains the context of Cryptonight algorithm and is protected.
Is it safe ?
You must be careful when running a software as root on your computer. There is however no risk here is you've download the mining software from the official repository.
Note that these optimizations are not in lucasjones original software but have been added by wolf9466 (however it tried to change niceness regardless of user but was not advising to run as root).