0

We are facing issues while connection to Redis in out localhost through spring-data-redis (spring boot application).

Data collected through profiler

Issue 1: Most of the time application is spending in getConnection(), releaseConnection() and socket IOs.

Sample Code :-

public void addValuesInSet(){
        long startTime = System.currentTimeMillis();
        for(int i = 1;  i < 2000 ; i++) {
            final String tempKey = i + "";
            for (int j = 0; j < 100; j++) {
                redisTemplate.boundHashOps(tempKey).put( j +"" , j + "");
            }
        }
        long endTime = System.currentTimeMillis();
        System.out.println("total time : " + (endTime - startTime));
    }

Issue 2: Even with idle connection available in pool, application is trying to create more collection.

spring.redis.pool.max-idle=100
spring.redis.pool.max-active=100
spring.redis.pool.max-wait=-1
spring.redis.pool.min-idle=50

Is there any way to improve on this?

Pragati
  • 1
  • 2
  • Could you elaborate on your expectations? Right now you're saying, that when you initiate I/O, the Java I/O methods are heavily utilized which is a natural consequence of what you're doing. – mp911de Jun 29 '17 at 12:08
  • Time actually taken to perform actions in Redis is Ok. However, it is taking too much time in getConnection() and releaseConnection() inspite of using pool. Is there any way to improve that? – Pragati Jun 30 '17 at 09:29

0 Answers0