Skip to content

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

Open
sharksforarms wants to merge 1 commit intoh2o:masterfrom
sharksforarms:sharksforarms/neverbleed-threads
Open

use a configurable amount of worker threads to handle requests#66
sharksforarms wants to merge 1 commit intoh2o:masterfrom
sharksforarms:sharksforarms/neverbleed-threads

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