Skip to content

Instantly share code, notes, and snippets.

@shaharmor
Last active March 21, 2017 20:50
Show Gist options
  • Save shaharmor/7fbf9ef4cf606b06c214 to your computer and use it in GitHub Desktop.
Save shaharmor/7fbf9ef4cf606b06c214 to your computer and use it in GitHub Desktop.
ioredis memory leak
var Redis = require('ioredis');
// single instance
//var redis = new Redis();
// cluster
var redis = new Redis.Cluster([
{
"host": "127.0.0.1",
"port": 6380
}, {
"host": "127.0.0.1",
"port": 6381
}, {
"host": "127.0.0.1",
"port": 6382
}
]);
var i = 0;
var key = 'key';
function send() {
console.log(process.memoryUsage());
for (var j = 0; j < 1000; j++) {
redis.set(key, i++);
}
}
setInterval(function() {
send();
}, 500);
@sheyaweidberg
Copy link

Hi, are you still having this on 2.5.0? We had a similar issue (without clusters). Did you resolve it and if so how? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment