Skip to content

Instantly share code, notes, and snippets.

@ramonsnir
Created February 21, 2016 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramonsnir/bb7158931db43cb7185e to your computer and use it in GitHub Desktop.
Save ramonsnir/bb7158931db43cb7185e to your computer and use it in GitHub Desktop.
leaking docker-compose
FROM node:4.3.1
ADD . .
RUN npm install
CMD node test.js
test:
build: .
links:
- redis
redis:
image: grokzen/redis-cluster

Checkout 2.x branch. Download the three other files to the root directory of the repo.

docker-compose build docker-compose run

See if it can reach 150_000_000 in about a minute.

var Redis = require('./index');
var redis = new Redis.Cluster([
{
port: 7001,
host: 'redis',
},
{
port: 7002,
host: 'redis',
},
{
port: 7003,
host: 'redis',
},
]);
var i = 0;
function send() {
console.log(process.memoryUsage());
for (var j = 0; j < 1000; j++) {
redis.set('quay', i++);
}
}
setInterval(function() {
send();
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment