Redis fetch takes time using redisson
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
add a comment |
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
add a comment |
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
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
java concurrency redis redisson
edited Nov 14 '18 at 12:02
ArunavaS
asked Nov 14 '18 at 11:17
ArunavaSArunavaS
879
879
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap
method instead.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap
method instead.
add a comment |
Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap
method instead.
add a comment |
Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap
method instead.
Stream uses iterator provided by RMapCache object. It fetches only 10 elements by default, I would recommend you to use RMapCache.readAllMap
method instead.
answered Dec 24 '18 at 15:34
Nikita KoksharovNikita Koksharov
6,1703752
6,1703752
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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