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

Executor thread - cpu affinity not working #1732

Closed
matteo-gsr opened this issue Jan 26, 2025 · 3 comments
Closed

Executor thread - cpu affinity not working #1732

matteo-gsr opened this issue Jan 26, 2025 · 3 comments

Comments

@matteo-gsr
Copy link
Contributor

Hi,

I am using the embedded C media driver in dedicated threading mode and I am setting a CPU affinity on each of the conductor, sender and receiver threads.

It seems there's an aeron_executor thread which doesn't get the affinity. It looks like it's spawn by the conductor agent. However, it's not getting the same affinity.

It is problematic given it then ends up on the same isolated core of the critical thread, which I really don't want to.

@vyazelenko
Copy link
Contributor

Fixed with ae665d9.

There is now a separate configuration option to set CPU affinity for the async executor thread, i.e. via aeron.driver.async.executor.cpu.affinity property or AERON_DRIVER_ASYNC_EXECUTOR_CPU_AFFINITY env variable.

@matteo-gsr
Copy link
Contributor Author

thank you very much @vyazelenko !

@matteo-gsr
Copy link
Contributor Author

matteo-gsr commented Feb 1, 2025

@vyazelenko - sorry to revive this thread. Is it possible to add the setter methods to set the affinity, similar to other existing setter methods in the C driver? They are necessary when interacting with FFI, as we cannot change the context struct directly.

e.g.

https://github.com/aeron-io/aeron/blob/master/aeron-driver/src/main/c/aeron_driver_context.c#L3085

Ideally, one would have the setters for these members:

  • set_sender_cpu_affinity_no
  • set_receiver_cpu_affinity_no
  • set_conductor_cpu_affinity_no
  • set_async_executor_cpu_affinity_no

Thank you.

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