Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Sorry for my english

I change value tcp_max_syn_backlog in sysctl in my ubuntu server 10.04 for growing SYN_RECV queue. But isnt work (I flood this server by hping). But, when i change somaxconn (in documentation its only for est connection, its must not work), netstat give me 512 (by default config 256).

root@web2:~# sysctl -a|egrep '(somax|syncoo|backlog)'
error: permission denied on key 'net.ipv4.route.flush'
net.core.somaxconn = 128
net.core.netdev_max_backlog = 1000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 512
error: permission denied on key 'net.ipv6.route.flush'
root@web2:~# netstat -altpun|grep SYN|wc -l
256
root@web2:~# echo 1024 > /proc/sys/net/ipv4/tcp_max_syn_backlog 
root@web2:~# netstat -altpun|grep SYN|wc -l
256
root@web2:~# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
nginx.
root@web2:~# netstat -altpun|grep SYN|wc -l
256
root@web2:~# echo 256 > /proc/sys/net/core/somaxconn 
root@web2:~# netstat -altpun|grep SYN|wc -l
256
root@web2:~# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
nginx.
root@web2:~# netstat -altpun|grep SYN|wc -l
512
root@web2:~# echo 512 > /proc/sys/net/core/somaxconn 
root@web2:~# echo 2048 > /proc/sys/net/ipv4/tcp_max_syn_backlog 
root@web2:~# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
nginx.
root@web2:~# netstat -altpun|grep SYN|wc -l
512

With or without syncookie. What i'm doing wrong?

share|improve this question
    
You're measuring in a way that doesn't make much sense. The whole point of SYN cookies is that you don't keep track of the SYNs. Yet you're measuring how many SYNs the system has kept track of. –  David Schwartz Apr 17 '12 at 14:12
    
Thank for answer! But when i measure without syncookie, i get some (with 512 in backlog i have 256 in netstat). And why, when i was changed somaxconn, netstat value groved? –  Konstantin Apr 17 '12 at 15:20
    
The soamxconn value sets the number of tracked connections. SYN cookies allows untracked connections. –  David Schwartz Apr 17 '12 at 20:26
    
Thanks! I got it! My trouble was been in next: 1. I was thinking, what somaxconn is limit for queue only established connection, not for SYN_RECV. 2. Some service have personal limit somaxconn: in nginx, for example, need set backlog=value in listen directive. –  Konstantin Apr 18 '12 at 12:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.