Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Use a default ThreadCount that wont cause the number of threads to be…
Browse files Browse the repository at this point in the history
… a bottleneck. (#59)
  • Loading branch information
tmds authored Jul 7, 2018
1 parent c44b056 commit 2c579aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ The Transport has these options:
- **DeferSend**: This defers sends to the Transport Thread which increases chances for multiple sends to coalesce. This options
defaults to true.

- **ThreadCount**: Specifies the number of Transport Threads. This defaults to the number of logical processors in the system divided by 4.
- **ThreadCount**: Specifies the number of Transport Threads. This defaults to the number of logical processors in the system, maxed to 16.

- **AioSend/AioReceive**: Uses Linux AIO system calls to batch send and receive calls. AioSend implies DeferSend. These options default to true.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ public LinuxTransportOptions()
AioSend = true;
AioReceive = true;

// Benchmarking Techempower Json on 24-core machine with hyper threading (ProcessorCount = 48)
// shows best performance at ThreadCount 12.
// TODO: what happens if hyperthreading is disabled? Perhaps this should be half the cores?
// TODO: benchmark more scenarios to validate this is a good default.
ThreadCount = Math.Max((Environment.ProcessorCount + 2) / 4, 1);
// Use a default ThreadCount that wont cause the number of threads
// to be a bottleneck.
// Users that want to optimize, should do their own benchmarks.
ThreadCount = Math.Min(Environment.ProcessorCount, 16);
}

internal bool ReceiveOnIncomingCpu
Expand Down

0 comments on commit 2c579aa

Please sign in to comment.