-
Notifications
You must be signed in to change notification settings - Fork 3.9k
FAQ
Try setting own timeout value when constructing JedisPool using the following constructor:
JedisPool(GenericObjectPoolConfig poolConfig, String host, int port, int timeout)where timeout is given as milliseconds.
Default timeout value is 2 seconds.
JedisPool defaults to 8 connections, you can change this in the PoolConfig:
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(maxTotal); // maximum active connections
poolConfig.setMaxIdle(maxIdle); // maximum idle connectionsTake into account that JedisPool inherits commons-pool BaseObjectPoolConfig which has a lot of configuration parameters.
We've set some defined ones which suit most of the cases. In case, you experience issues tuning these parameters may help.
The buffer size of all Jedis sockets in an application can be configured through system property.
Buffer size of input stream can be configured by setting jedis.bufferSize.input or jedis.bufferSize system property.
Buffer size of output stream can be configured by setting jedis.bufferSize.output or jedis.bufferSize system property.
If you want to set the buffer size of both input and output stream to same value, you can just set jedis.bufferSize.
Note: This feature is available since Jedis 4.2.0.