Skip to content

Instantly share code, notes, and snippets.

@jolynch
Last active November 29, 2016 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jolynch/51ab8d47f084053f00f2 to your computer and use it in GitHub Desktop.
Save jolynch/51ab8d47f084053f00f2 to your computer and use it in GitHub Desktop.
Experiment: Use iptables to drop SYNs
# 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
$ 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)
@huangjunque
Copy link

syn is diao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment