jedis icon indicating copy to clipboard operation
jedis copied to clipboard

Performance issue version 5.1.3

Open otavio-zoop opened this issue 1 week ago • 0 comments

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 Captura de tela de 2024-06-26 12-05-46

with Jedis 5.1.3

537 µs Captura de tela de 2024-06-26 12-10-21

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),
    )
}

Redis / Jedis Configuration

Jedis version: 5.1.3

Redis version: Aws ElastiCache 7.1.0

Java version: 17

otavio-zoop avatar Jun 26 '24 15:06 otavio-zoop