jedis
jedis copied to clipboard
Performance issue version 5.1.3
Hello!
I migrated from Jedis version 3.10.0 to 5.1.3, and I noticed an increase in the execution time of GET and SET operations through the Datadog trace, as you can see in the images below:
with Jedis 3.10.0
18.5 µs
with Jedis 5.1.3
537 µs
from 18.5 µs to 537 µs is a big difference, I did many runs and the results were very similar
Expected behavior
Similar execution time
Actual behavior
Increased execution time
Steps to reproduce:
Below is my configuration and the code that is executed. I ran exactly this with the same code, only changing the Jedis version.
private fun createJedisPool(databaseIndex: Int): JedisPool {
val pool =
GenericObjectPoolConfig<Jedis>().also {
it.maxTotal = 200
it.maxIdle = 10
it.minIdle = 3
it.setMaxWait(Duration.ofMillis((10000)))
it.blockWhenExhausted = true
it.testOnBorrow = true
it.testWhileIdle = true
}
val config =
DefaultJedisClientConfig.builder().also {
it.database(databaseIndex)
it.connectionTimeoutMillis(Duration.ofSeconds(30).toMillis().toInt())
it.ssl(true)
it.password(password)
}.build()
return JedisPool(pool, HostAndPort(host, setPort()), config as JedisClientConfig) // also tried JedisPooled, same result
}
simple SET execution
pool.resource.use {
it.set(
"id",
"value",
SetParams().px(5000),
)
}