Redis fetch takes time using redisson










1















I have a scenario where application need to to get operation from redis around 80 times per request. When I am hitting 1 request on that application it gives response in less than 1 seconds but when increased the request size to 100 redissonClient starts behaving slowly and takes around 13 seconds to fetch 250 records.



I am new to redis and unsure if this is default. Though I found out in some article saying redis can handle millions of operation in 1 second on 1 node. Our redis server is running on 1 node currently.



Below is the redis configuration:




"singleServerConfig":
"idleConnectionTimeout": 10000,
"pingTimeout": 1000,
"connectTimeout": 10000,
"timeout": 2000,
"retryAttempts": 3,
"retryInterval": 1500,
"reconnectionTimeout": 2000,
"failedAttempts": 3,
"password": null,
"subscriptionsPerConnection": 5,
"clientName": null,
"address": "redis://172.18.17.207:6379",
"subscriptionConnectionMinimumIdleSize": 1,
"subscriptionConnectionPoolSize": 50,
"connectionMinimumIdleSize": 32,
"connectionPoolSize": 100,
"database": 0,
"dnsMonitoringInterval": 5000
,
"threads": 128,
"nettyThreads": 128,
"codec": null,
"useLinuxNativeEpoll": false



And below is how I am instantiating redisson client at the time of startup:



try 
Config config = Config.fromJSON(CommonConstants.REDIS_SINGLE_CONFIG_JSON_FILE);
redisClient = Redisson.create(config);
catch (IOException e)
log.error(null, "Error establishing connection to Redis Cluster!", e);



And below is how I am fetching records:



public List<Map<String, String>> fetch(List<String> ids) 
return ids.stream().map(id ->
Map<String, String> m = redisClient.getMapCache(id);
return m;
).collect(Collectors.toList());



I suspect I have wrongly configured redis client but could not figure out what is that.



Any help/light is much appreciated.



Thanks










share|improve this question




























    1















    I have a scenario where application need to to get operation from redis around 80 times per request. When I am hitting 1 request on that application it gives response in less than 1 seconds but when increased the request size to 100 redissonClient starts behaving slowly and takes around 13 seconds to fetch 250 records.



    I am new to redis and unsure if this is default. Though I found out in some article saying redis can handle millions of operation in 1 second on 1 node. Our redis server is running on 1 node currently.



    Below is the redis configuration:




    "singleServerConfig":
    "idleConnectionTimeout": 10000,
    "pingTimeout": 1000,
    "connectTimeout": 10000,
    "timeout": 2000,
    "retryAttempts": 3,
    "retryInterval": 1500,
    "reconnectionTimeout": 2000,
    "failedAttempts": 3,
    "password": null,
    "subscriptionsPerConnection": 5,
    "clientName": null,
    "address": "redis://172.18.17.207:6379",
    "subscriptionConnectionMinimumIdleSize": 1,
    "subscriptionConnectionPoolSize": 50,
    "connectionMinimumIdleSize": 32,
    "connectionPoolSize": 100,
    "database": 0,
    "dnsMonitoringInterval": 5000
    ,
    "threads": 128,
    "nettyThreads": 128,
    "codec": null,
    "useLinuxNativeEpoll": false



    And below is how I am instantiating redisson client at the time of startup:



    try 
    Config config = Config.fromJSON(CommonConstants.REDIS_SINGLE_CONFIG_JSON_FILE);
    redisClient = Redisson.create(config);
    catch (IOException e)
    log.error(null, "Error establishing connection to Redis Cluster!", e);



    And below is how I am fetching records:



    public List<Map<String, String>> fetch(List<String> ids) 
    return ids.stream().map(id ->
    Map<String, String> m = redisClient.getMapCache(id);
    return m;
    ).collect(Collectors.toList());



    I suspect I have wrongly configured redis client but could not figure out what is that.



    Any help/light is much appreciated.



    Thanks










    share|improve this question


























      1












      1








      1








      I have a scenario where application need to to get operation from redis around 80 times per request. When I am hitting 1 request on that application it gives response in less than 1 seconds but when increased the request size to 100 redissonClient starts behaving slowly and takes around 13 seconds to fetch 250 records.



      I am new to redis and unsure if this is default. Though I found out in some article saying redis can handle millions of operation in 1 second on 1 node. Our redis server is running on 1 node currently.



      Below is the redis configuration:




      "singleServerConfig":
      "idleConnectionTimeout": 10000,
      "pingTimeout": 1000,
      "connectTimeout": 10000,
      "timeout": 2000,
      "retryAttempts": 3,
      "retryInterval": 1500,
      "reconnectionTimeout": 2000,
      "failedAttempts": 3,
      "password": null,
      "subscriptionsPerConnection": 5,
      "clientName": null,
      "address": "redis://172.18.17.207:6379",
      "subscriptionConnectionMinimumIdleSize": 1,
      "subscriptionConnectionPoolSize": 50,
      "connectionMinimumIdleSize": 32,
      "connectionPoolSize": 100,
      "database": 0,
      "dnsMonitoringInterval": 5000
      ,
      "threads": 128,
      "nettyThreads": 128,
      "codec": null,
      "useLinuxNativeEpoll": false



      And below is how I am instantiating redisson client at the time of startup:



      try 
      Config config = Config.fromJSON(CommonConstants.REDIS_SINGLE_CONFIG_JSON_FILE);
      redisClient = Redisson.create(config);
      catch (IOException e)
      log.error(null, "Error establishing connection to Redis Cluster!", e);



      And below is how I am fetching records:



      public List<Map<String, String>> fetch(List<String> ids) 
      return ids.stream().map(id ->
      Map<String, String> m = redisClient.getMapCache(id);
      return m;
      ).collect(Collectors.toList());



      I suspect I have wrongly configured redis client but could not figure out what is that.



      Any help/light is much appreciated.



      Thanks










      share|improve this question
















      I have a scenario where application need to to get operation from redis around 80 times per request. When I am hitting 1 request on that application it gives response in less than 1 seconds but when increased the request size to 100 redissonClient starts behaving slowly and takes around 13 seconds to fetch 250 records.



      I am new to redis and unsure if this is default. Though I found out in some article saying redis can handle millions of operation in 1 second on 1 node. Our redis server is running on 1 node currently.



      Below is the redis configuration:




      "singleServerConfig":
      "idleConnectionTimeout": 10000,
      "pingTimeout": 1000,
      "connectTimeout": 10000,
      "timeout": 2000,
      "retryAttempts": 3,
      "retryInterval": 1500,
      "reconnectionTimeout": 2000,
      "failedAttempts": 3,
      "password": null,
      "subscriptionsPerConnection": 5,
      "clientName": null,
      "address": "redis://172.18.17.207:6379",
      "subscriptionConnectionMinimumIdleSize": 1,
      "subscriptionConnectionPoolSize": 50,
      "connectionMinimumIdleSize": 32,
      "connectionPoolSize": 100,
      "database": 0,
      "dnsMonitoringInterval": 5000
      ,
      "threads": 128,
      "nettyThreads": 128,
      "codec": null,
      "useLinuxNativeEpoll": false



      And below is how I am instantiating redisson client at the time of startup:



      try 
      Config config = Config.fromJSON(CommonConstants.REDIS_SINGLE_CONFIG_JSON_FILE);
      redisClient = Redisson.create(config);
      catch (IOException e)
      log.error(null, "Error establishing connection to Redis Cluster!", e);



      And below is how I am fetching records:



      public List<Map<String, String>> fetch(List<String> ids) 
      return ids.stream().map(id ->
      Map<String, String> m = redisClient.getMapCache(id);
      return m;
      ).collect(Collectors.toList());



      I suspect I have wrongly configured redis client but could not figure out what is that.



      Any help/light is much appreciated.



      Thanks







      java concurrency redis redisson






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 12:02







      ArunavaS

















      asked Nov 14 '18 at 11:17









      ArunavaSArunavaS

      879




      879






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap method instead.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298972%2fredis-fetch-takes-time-using-redisson%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap method instead.






            share|improve this answer



























              0














              Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap method instead.






              share|improve this answer

























                0












                0








                0







                Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap method instead.






                share|improve this answer













                Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap method instead.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 24 '18 at 15:34









                Nikita KoksharovNikita Koksharov

                6,1983753




                6,1983753





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298972%2fredis-fetch-takes-time-using-redisson%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto