====== AB Testing kernel: possible SYN flooding on port 80. Sending cookies. ======
Hari ini kami menginstall server dan kemudian melakukan ab testing namun tiba-tiba proses terhenti dan keluar pesan seperti ini
[root@id2 ~]# ab -kc 1000 -n 10000 http://localhost/index.php
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
apr_socket_recv: Connection reset by peer (104)
Total of 7821 requests completed
kemudian kami cek di
tail -f /var/log/messages
dan menemukan error
Apr 13 04:03:36 id2 kernel: possible SYN flooding on port 80. Sending cookies.
Apr 13 04:06:34 id2 kernel: possible SYN flooding on port 80. Sending cookies.
===== Solusinya? =====
Edit sysctl
nano /etc/sysctl.conf
Ubah atau tambahkan nilai setting berikut ini
net.ipv4.tcp_max_syn_backlog=5000
net.core.somaxconn=4086
kemudian load ulang sysctl
sysctl -p
dan lakukan kembali ab testing
ab -kc 1000 -n 10000 http://localhost/index.php
Harusnya sudah tidak terdapat error lagi.