-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow config of IO and acceptor threads in proxy #14054
Conversation
Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins)
@addisonj:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
this.workerGroup = EventLoopUtil.newEventLoopGroup(numThreads, false, workersThreadFactory); | ||
this.acceptorGroup = EventLoopUtil.newEventLoopGroup(proxyConfig.getNumAcceptorThreads(), | ||
false, acceptorThreadFactory); | ||
this.workerGroup = EventLoopUtil.newEventLoopGroup(proxyConfig.getNumIOThreads(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous default numThreads
is Runtime.getRuntime().availableProcessors()
, but the current default numThreads
is Runtime.getRuntime().availableProcessors()
. It has break the default behavior. Do we need to keep the default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move to the same default as the broker... primarily because I don't think having a single IO thread is generally something we want to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Allow config of IO and acceptor threads in proxy Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins) * fix checkstyle (cherry picked from commit f455418)
* Allow config of IO and acceptor threads in proxy Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins) * fix checkstyle (cherry picked from commit f455418)
* Allow config of IO and acceptor threads in proxy Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins) * fix checkstyle (cherry picked from commit f455418) (cherry picked from commit 1742df8)
* Allow config of IO and acceptor threads in proxy Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins) * fix checkstyle
* Allow config of IO and acceptor threads in proxy Previously, the Pulasr Proxy did not allow configuration of the number of IO threads and acceptor threads in the proxy. These options can be very important to tune, as is tuneable in the broker, so this change simply matches the brokers perspective. Also, we increase the default number of IO threads to 2x number of processors instead of 1x, as in a single CPU config, it still makes sense to have 2 threads, at least for now, where some blocking operatings can happen (such as authn/authz plugins) * fix checkstyle (cherry picked from commit f455418)
@addisonj When submitting a PR, can you provide doc-related info (tick the box) in the PR description? So that Bot can recognize and label your PR correspondingly. Or else Bot labels your PR with |
@momo-jun a soft reminder: here is a PR w/ doc-required label, could u pls follow up? Thanks |
@Anonymitaet, this PR requires changes to both config files and docs. @Demogorgon314 has taken care of it. |
Motivation
Previously, the Pulasr Proxy did not allow configuration of the number
of IO threads and acceptor threads in the proxy.
These options can be very important to tune, as is tuneable in the
broker, so this change simply matches the brokers perspective.
Modifications
This adds the options to tune threads to the proxy.
It also increases the default number of IO threads to 2x number of
processors instead of 1x, as in a single CPU config, it still makes
sense to have 2 threads, at least for now, where some blocking
operatings can happen (such as authn/authz plugins)
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Javadoc is updated, but reference docs need updated as well