Testing MongoDB Over the WAN: Part 1
This will be my first multi-part blog post, and I am actually not sure just how many parts it will have by the time I am finished. My original intent was to test some failure scenarios whereby I would emulate a WAN link disappearing. That quickly expanded into a more ambitious test, I still wanted to test failure scenarios but I also wanted to test with some real world (ish) values for latency, packet loss, jitter etc.
In particular, I wanted to see how a sharded MongoDB cluster would behave with this type of variable performance and what I could do to make things better (I have some interesting ideas there), as well as test some improvements in the 2.6 version. I’ve created configurations like this in labs with hardware (expensive), XenServer (paid) but I wanted something others could reproduce, reuse and preferably easily and at no cost. Hence I decided to see if I could make this work with VirtualBox (I also plan to come up with something similar for Docker/Containers having read this excellent summary, but that is for later).
My immediate thought was to use Traffic Control but I had a vague recollection of having used a nice utility in the past that gave me a nice (basic) web interface for configuring various options, and was fairly easy to set up. A bit of quick Googling got me to WANem and this was indeed what I had used in the past. I recalled the major drawback at the time was that after booting it, we needed to reconfigure each time because it was a live CD. Hence the first task was to fix that and get it to the point that it was a permanent VM (note: there is a pre-built VMWare appliance available for those on that platform).
That was reasonably straight forward, and I wrote up the process over at SuperUser as a Q&A:
http://superuser.com/q/724551/113572
Once that was done, it was time to configure the interfaces, make routing work and test that the latency and packet loss settings actually worked (continues after the jump).