Skip to content

Commit cb5d392

Browse files
authored
docs: add Linux thread priority guidance (#2943)
1 parent 3cebcb9 commit cb5d392

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/articles/faq.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ For example, you can use the `SimpleJob` or `ShortRunJob` attributes:
8383
}
8484
```
8585

86+
* **Q** I'm running benchmarks on Linux and I see: `// ! Failed to set up priority Highest for thread ... Make sure you have the right permissions.` What can I do?
87+
88+
**A** This message can appear when using in-process toolchains (for example via `[InProcess]`) because BenchmarkDotNet tries to set `ThreadPriority.Highest`. On Linux, raising scheduling priority requires additional permissions. Instead of running the whole benchmark as root (which can create root-owned build artifacts), you can grant the benchmark executable the `CAP_SYS_NICE` capability:
89+
90+
```bash
91+
sudo setcap cap_sys_nice=eip /path/to/YourBenchmarksExecutable
92+
```
93+
94+
If you don't need high thread priority, you can ignore the message or avoid in-process toolchains.
95+
8696
* **Q** I have failed to run my benchmarks from LINQPad. How can I fix this problem?
8797

8898
```

0 commit comments

Comments
 (0)