-
-
Save jolynch/51ab8d47f084053f00f2 to your computer and use it in GitHub Desktop.
Experiment: Use iptables to drop SYNs
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
# Restart haproxy every second | |
while [ 1 ]; do | |
sudo iptables -I INPUT -p tcp --dport 16000 --syn -j DROP | |
sleep 0.2 | |
./haproxy -f /tmp/haproxy.cfg -p /tmp/haproxy.pid -sf $(cat /tmp/haproxy.pid) | |
sudo iptables -D INPUT -p tcp --dport 16000 --syn -j DROP | |
sleep 1 | |
done |
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
$ ab -c 10 -n 200000 169.254.255.254:16000/ | |
Benchmarking 169.254.255.254 (be patient) | |
... | |
Complete requests: 200000 | |
Failed requests: 0 | |
... | |
50% 2 | |
95% 2 | |
99% 6 | |
100% 1002 (longest request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
syn is diao