Search code examples
javaredislettuce

Redis like a database


We have a redis with standalone configuration and I am using lettuce to connect with it. When we have one single user to access redis database the result api is fast, about 700ms, but when we have more then 5 users to consume this api that access redis database the time is increased more than 1 or 2 seconds. How can garantee many users to consume my api without lost performance time?

PS: we have a java API (Spring boot) + lettuce + JPA without pool or explicit blocking operation. We have only findBy operations and may this API will be access about 30000 users


Solution

  • Try increasing the minimum idle connection pool and and active connection pool. Something like below:

    lettuce:
      pool:
        max-active: 64
        max-idle: 64
        min-idle: 16
    

    Try and fine tune these values as per your infrastructure and need. You might have to add connection pool dependency for lettuce cause it might not come by default. Something like commons-pool2