You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please find below the code that sends 100 set commands in a for loop. For some execution each set command is sent as individual packet to redis server and each response ("ok") is received as individual packet.
On some executions multiple set commands are sent in one packet to redis server and the responses are grouped into one packet.
const Redis = require('ioredis');
let endpoints = new Array(1)
endpoints[0] = { host: "ip", port: 26379};
const redis = new Redis({
sentinels: endpoints,
password: '',
name: 'mymaster',
role: 'master',
});
console.log(redis)
redis.on('connect', function(err) {
if(err) {
console.log('error: ' + JSON.stringify(err));
return;
}
console.log('[Redis] up and running!');
return;
});
for (let i = 0; i < 100; i++) {
redis.set('hello' + i, 'test' + i, 'EX', 60, function(err,result) {
console.log('set command error response: ' + err)
console.log('set command result: ' + result)
});
}
When the volume of requests is high to the node.js microservice, less packets with more number of set commands are sent to redis sentinel host. The microservice memory keeps growing and crashes with OOM.
Trying to understand how the grouping of commands happens when pipeline is not used and also the auto pipeline is not enabled.
can this grouping behavior cause memory issues as observed in my case? Is there a way to force one command per request?
ioredis version - 4.11.2
Please advice. Any pointers will be of great help. Thank you
The text was updated successfully, but these errors were encountered:
Please find below the code that sends 100 set commands in a for loop. For some execution each set command is sent as individual packet to redis server and each response ("ok") is received as individual packet.
On some executions multiple set commands are sent in one packet to redis server and the responses are grouped into one packet.
const Redis = require('ioredis');
let endpoints = new Array(1)
endpoints[0] = { host: "ip", port: 26379};
const redis = new Redis({
sentinels: endpoints,
password: '',
name: 'mymaster',
role: 'master',
});
console.log(redis)
redis.on('connect', function(err) {
if(err) {
console.log('error: ' + JSON.stringify(err));
return;
}
console.log('[Redis] up and running!');
return;
});
for (let i = 0; i < 100; i++) {
redis.set('hello' + i, 'test' + i, 'EX', 60, function(err,result) {
console.log('set command error response: ' + err)
console.log('set command result: ' + result)
});
}
When the volume of requests is high to the node.js microservice, less packets with more number of set commands are sent to redis sentinel host. The microservice memory keeps growing and crashes with OOM.
Trying to understand how the grouping of commands happens when pipeline is not used and also the auto pipeline is not enabled.
can this grouping behavior cause memory issues as observed in my case? Is there a way to force one command per request?
ioredis version - 4.11.2
Please advice. Any pointers will be of great help. Thank you
The text was updated successfully, but these errors were encountered: