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

Disable JMX of GenericObjectPoolConfig for speed #1223

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@RobinDong

RobinDong commented Feb 22, 2016

When running 32 threads and every thread has a JedisCluster(), the
program will spend more than 30 seconds to init 32 JedisCluster()
instances.
The reason is in commons-pool-2.4 :

GenericObjectPool() --> BaseGenericObjectPool() --> jmxRegister()

the jmxRegister() will spend a lot of time to register MBean because
it always use the same Instance name and have to loop many turns.

Because users can't affort minutes to init multi-instances of
JedisCluster(), I suggest to defaultly disable JMX in JedisCluster().

Disable JMX of GenericObjectPoolConfig
When running 32 threads and every thread has a JedisCluster(), the
program will spend more than 30 seconds to init 32 JedisCluster()
instances.
The reason is in commons-pool-2.4 :

    GenericObjectPool() --> BaseGenericObjectPool() --> jmxRegister()

the jmxRegister() will spend a lot of time to register MBean because
it always use the same Instance name and have to loop many turns.

Because users can't affort minutes to init multi-instances of
JedisCluster(), I suggest to defaultly disable JMX in JedisCluster().

@RobinDong RobinDong changed the title from Disable JMX of GenericObjectPoolConfig to Disable JMX of GenericObjectPoolConfig for speed Feb 22, 2016

@marcosnils

This comment has been minimized.

Show comment
Hide comment
@marcosnils

marcosnils Feb 22, 2016

Collaborator

@RobinDong JedisCluster is multi-threaded as it uses JedisPool internally. Is there a reason why you're using one instance per thread?

We can't change this default behavior because there might be many Jedis users that are expecting JMX to be enabled by default (as it is today). As you still have the ability to disable JMX for your app only, I don't see the reason to make it a default.

Collaborator

marcosnils commented Feb 22, 2016

@RobinDong JedisCluster is multi-threaded as it uses JedisPool internally. Is there a reason why you're using one instance per thread?

We can't change this default behavior because there might be many Jedis users that are expecting JMX to be enabled by default (as it is today). As you still have the ability to disable JMX for your app only, I don't see the reason to make it a default.

@marcosnils marcosnils closed this Feb 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment