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

use a configurable amount of worker threads to handle requests #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sharksforarms
Copy link
Contributor

instead of having a 1-1 mapping between application thread and neverbleed threads, we can configure a static pool of threads that can handle incoming requests.

Using epoll features, we can have an idle thread handle the next incoming request.

In summary, there is an epoll instance per thread. The client fd is added to each thread's epoll instance with EPOLLEXCLUSIVE, so that only a single instance will get woke when the fd is ready.

For offload events, we keep these on the same thread the offload request was started on, I found that offload requests cannot be resumed on a different thread, see intel/QAT_Engine#306

Other:

  • removed the ability to set thread affinity (makes less sense when having a thread-pool vs 1-1 mapping with application thread)
  • removed yield_on_read as we poll to see if the fd is still read-able

instead of having a 1-1 mapping between application thread and neverbleed threads,
wewe can configure a static pool of threads that can handle incoming requests.

Using epoll features, we can have an idle thread handle the next incoming request.
@sharksforarms sharksforarms marked this pull request as ready for review May 22, 2024 13:06
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.

1 participant