LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-07-2011, 05:39 AM   #1
chandranjoy
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Rep: Reputation: 0
Server has more TIME_WAIT connections in Apache(port 80)


Hi,
My webserver has 16GB of RAM and CentOS 5.5, Apache 2.2.3, It's shared webserver used of for webhosting. I have optmized the server as :
<IfModule prefork.c>
StartServers 8
MinSpareServers 10
MaxSpareServers 20
ServerLimit 2150
MaxClients 2000
MaxRequestsPerChild 8000
</IfModule>

Timeout 90
MaxKeepAliveRequests 100

Server is not using Worker MPM, however just assign the following values.
<IfModule worker.c>
StartServers 8
MaxClients 2150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 8000
</IfModule>

More number of TIME_WAIT Connections on server still exists.

[root@server ~]# netstat -an|grep ":80"|awk '/tcp/ {print $6}'|sort -nr| uniq -c
1681 TIME_WAIT
2 SYN_RECV
4 LISTEN
3 LAST_ACK
7 FIN_WAIT1
6 ESTABLISHED
3 CLOSING

[root@server ~]# netstat -tan |grep :80|grep TIME_WAIT |wc -l
1776

Server Load Avg: 2.36, 2.45, 2.79

Please help me how to reduce the TIME_WAIT connections.

Thanks,
Jay
 
Old 01-07-2011, 07:11 AM   #2
chandranjoy
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Now I have found the answer:
I have tweaked the apache as :

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 10
MaxSpareServers 20
ServerLimit 2150
MaxClients 2000
MaxRequestsPerChild 8000
</IfModule>

Now the Apache connections states:
# netstat -an|grep ":80"|awk '/tcp/ {print $6}'|sort -nr| uniq -c
126 TIME_WAIT
4 SYN_RECV
4 LISTEN
8 LAST_ACK
90 FIN_WAIT2
2 FIN_WAIT1
111 ESTABLISHED

# netstat -tan |grep :80 |wc -l
215

# netstat -tan |grep :80 |grep TIME_WAIT |wc -l
66

Now websites are loading fast.

Thanks,
Jayachandran Palanisamy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Server making LOTS of outbound connections to different IP addresses on port 22 SyntheticRed Linux - Security 4 09-29-2009 11:16 AM
ssh port forwarding as a proxy server: how to be aware of the current connections Gozer404 Linux - Security 2 07-15-2009 11:22 AM
Configuring Automatic Redirects from port 80 to port 443 with bundled Apache server kaplan71 Fedora 1 12-28-2007 08:30 AM
Server Not allowing any port connections. atomicx Linux - Networking 6 08-25-2006 02:34 PM
How do I close TIME_WAIT connections? linuxboy69 Linux - Software 2 09-01-2004 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration