Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroTier on multiple threads #2233

Closed
wants to merge 38 commits into from
Closed

Conversation

joseph-henry
Copy link
Contributor

@joseph-henry joseph-henry commented Feb 23, 2024

ZeroTier on multiple threads

This alpha-quality patch enables concurrent processing of packets in the RX and TX directions and appears to improve performance significantly in many situations (but also make some worse). It automatically scales thread count according to std::thread::hardware_concurrency() and can optionally be overridden at start time by setting the ZT_PACKET_PROCESSING_CONCURRENCY environment variable. You can enable CPU pinning at start time via ZT_CPU_PINNING=1.

This has only been tested on Linux and FreeBSD and is not fully implemented in macOS so don't even try.

Example usage (ZT_PACKET_PROCESSING_CONCURRENCY is entirely optional since it'll automatically use all cores):

ZT_CPU_PINNING=1 ZT_PACKET_PROCESSING_CONCURRENCY=4 ./zerotier-one

To force ZeroTier onto one thread:

ZT_PACKET_PROCESSING_CONCURRENCY=1 ./zerotier-one

glimberg and others added 30 commits August 3, 2023 14:57
only need network and member IDs
Intention was to have (x >= 0 && x <= 8) but rules[rn].v.qosBucket is
unsigned (thus always >= 0)
Temporal integration with hosted controllers
remove some debug logging
@joseph-henry joseph-henry changed the title Jh zerotier multithread ZeroTier on multiple threads Feb 23, 2024
@joseph-henry joseph-henry self-assigned this Feb 23, 2024
@joseph-henry joseph-henry requested a review from rcoder February 23, 2024 17:36
@joseph-henry
Copy link
Contributor Author

Closing due to incorrect base branch. Will re-open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants