This program simulates the balancing of chunks in a MongoDB sharded system. It is useful for experimenting with different balancing algorithms. See doc/screenshot1.png for a screen shot of it running. Each box represents a shard. Each horizontal line in a box represents a chunk residing in that shard. When the balancer moves a chunk its line becomes red on the source shard and green on the destination shard. You can add and remove shards to see the balancing and draining in action. You also control insertion of documents. Currently you can just start or stop insertion of random keys at an average rate of 32MB per second. See step and insertDoc functions at the bottom of src/MongoShardingSimulation.hs to change this. Also, see event function to change user controls.
Note, there is a small bug in the Graphics library this is using which causes CPU usage to always increase. For our uses this does not negatively impact us since we won't be running it for hours yet. I have submitted a bug report to the author and expect him to address it since he seems to be actively maintaining it.