-
-
Save vindir/2d64f65c1bd6cfc3cabbd8b74d4a4429 to your computer and use it in GitHub Desktop.
simulate high latency replica sets (mac)
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
# first set up a pipe named "2" with bandwidth | |
# limited to 16kbit/s and latency of 100ms | |
sudo ipfw pipe 2 config bw 16Kbit/s delay 100ms | |
# next add rule #1 using the pipe we set up, configured to | |
# act only on local tcp traffic going to port 27019 | |
sudo ipfw add 1 pipe 2 tcp from me to me 27019 out | |
# now you should be observing slow ping times for | |
# mongod on 27019 | |
# let's disable rule #1 | |
sudo ipfw delete 1 | |
# back to normal! | |
# our pipe still exists so if we want to enable it again | |
sudo ipfw add 1 pipe 2 tcp from me to me 27019 out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment