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

Cannot set thread affinity in shared or sharednetwork modes for c media driver #1558

Open
apmorton opened this issue Feb 14, 2024 · 3 comments

Comments

@apmorton
Copy link

aeron_set_thread_affinity_on_start does a simple strcmp on the agent role, which is not set to any of the expected values in shared or sharednetwork modes, and so thread affinity values don't take effect.

@mikeb01
Copy link
Contributor

mikeb01 commented Feb 14, 2024

That is correct. The assumption is that if you are running with shared or shared_network threading modes it is unlikely that much will be gained from using thread affinity. Moving to dedicated mode will bring more latency improvements (especially in the long tail) over thread affinity. We generally recommend that applying thread affinity to be one of the steps applied very late in the tuning process.

@apmorton
Copy link
Author

The trouble is that in shared network mode AERON_CONDUCTOR_CPU_AFFINITY still applies, and because the conductor thread is the thread which starts the shared network thread (and after the affinity is applied), you end up with both threads pinned to the same core.

It should either be possible to set affinity for the shared network thread, or the affinity applied to the conductor shouldn't also be applied to the shared network thread.

@mikeb01
Copy link
Contributor

mikeb01 commented Feb 15, 2024

We may have a look into that case, but I think the original advice would still apply. If you don't have the cores available to run in dedicated mode, then you shouldn't be pinning the conductor thread either. This probably won't bring much benefit and could cause latency issues with other parts of your system.

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

No branches or pull requests

2 participants