Created
December 28, 2014 21:35
-
-
Save vincentwoo/756b65ae09a13b2842a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heapdump = require 'heapdump' | |
docker = new (require('dockerode'))(socketPath: '/var/run/docker.sock') | |
createContainer = (cb) -> | |
docker.createContainer { | |
Cmd: '/bin/bash' | |
Image: 'ubuntu:12.04' | |
}, (err, container) -> | |
container.remove {force: true}, cb | |
createContainers = (n, cb) -> | |
seen = 0 | |
for i in [1..n] | |
setTimeout createContainer, i * 50, -> | |
seen++ | |
cb() if seen == n | |
createContainers 100, -> | |
heapdump.writeSnapshot() | |
createContainers 10000, -> | |
heapdump.writeSnapshot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment