Skip to content

Config option to allow config netty event loop threads #652

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

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

zhenlineo
Copy link
Contributor

Added configuration option to allow users to config how many netty event loop threads they want to use.

Added configuration option to allow users to config how many netty event loop threads they want to use.
Copy link
Contributor

@PetrJanouch PetrJanouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@zhenlineo zhenlineo merged commit 6da6a69 into neo4j:4.0 Nov 27, 2019
@zhenlineo zhenlineo deleted the 4.0-event-loop-thread branch November 27, 2019 12:55
@elR1co
Copy link

elR1co commented Dec 2, 2019

Hello. Thanks a lot for the work done.
I am currently using version 1.7.5. In my application, I need to use a separate pool for a service, in order to restrict the number of connections, only for this case. In this case, I have two separate Driver instances, one for my generic pool, and one for this specific service. I noticed that every time I create a Driver instance, there are 2 * CPUs Neo4jDriverIO threads which are created, and in my case where I would just need maybe 5 connections max, I would not need more than 2 threads for example.
My question is : does this feature will solve my problem ? Will it be also merged to 1.7 branch soon ?

Thanks a lot again.

@zhenlineo
Copy link
Contributor Author

Hi @elR1co,
Yes, this PR will allow you to set the thread count used by netty thread pool used by this driver. You will be able to give 2 threads per driver. However currently there is no plan to back port this feature into 1.7. Our 4.0 driver is ready for a final release soon. The 4.0 driver will support all in-support Neo4j versions. Though you might need to change some code as we broke some public API.

@zhenlineo
Copy link
Contributor Author

Hi @elR1co,
The default value is 2 * availableProcessors. The 0 we used is an implementation detail. Deep down the stack, Netty will modify it to 2 * availableProcessors if it is 0. The constant is not exposed by Netty, thus we will not support the computation of processor count either. If you are interested, you can have a look at MultithreadEventLoopGroup.

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.

3 participants