Currently I noticed there are about 15K open connections to localhost. It is mainly connecting to Memcached. I am clueless where I should start to optimize TCP/IP stack. Memcached support UDP, but the PHP library doesn't support it.

The server has a lot of memory, about 7GB and it is dual core. Any pointers in how to optimize TCP / IP stack in Linux ?

link|improve this question
2  
Why do you feel that you need to optimize it? – Shane Madden Oct 24 '11 at 17:09
Is this large number of connections on the stack causing slow downs for other services? – user606723 Oct 24 '11 at 17:15
Doing performance testing, 39% of the time is spent getting data from memcached. To many open connections also causing the main site to slow down – mary Oct 24 '11 at 17:17
What is the output of netstat -natp | grep memcached | awk '{ print $6 }' | sort | uniq -c | sort -rn? – quanta Oct 25 '11 at 7:24
feedback

1 Answer

What state are the connections in? If you only need more TCP connections (with identical source-destination pairs), ip_local_port_range might be something to look at: http://www.faqs.org/docs/securing/chap6sec70.html . If you use connection tracking, http://www.faqs.org/docs/iptables/theconntrackentries.html might be useful. If you want to push the maximum connection/s, tcp_tw_recycle and tcp_tw_reuse might be interesting, but be careful with those and NAT.

link|improve this answer
I think the local port range is most likely to be your problem. – David Schwartz Oct 25 '11 at 2:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.