Server has more TIME_WAIT connections in Apache(port 80)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Server has more TIME_WAIT connections in Apache(port 80)
# 1  
Old 01-07-2011
Server has more TIME_WAIT connections in Apache(port 80)

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 :
Code:
<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.
Code:
<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.

Code:
[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

Last edited by radoulov; 01-07-2011 at 08:45 AM.. Reason: Code tags, please!
# 2  
Old 01-07-2011
Why do you want to reduce them? Why do you think they represent a problem?

Last edited by radoulov; 01-07-2011 at 09:04 AM..
# 3  
Old 01-07-2011
Hi,

Since that TIME_WAIT connections slow down my server and affects the website speed.

I have tweaked the apache to resolve this.

Thanks,
Jai

---------- Post updated at 06:37 PM ---------- Previous update was at 06:36 PM ----------

Hi,
Since that connections making my server very slow.. Now I have found the answer:
I have tweaked the apache as :

Quote:
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

[root@shwl-0006 ~]# netstat -tan |grep :80 |grep TIME_WAIT |wc -l
66
Now websites are loading fast.

Thanks,
Jayachandran Palanisamy
# 4  
Old 01-07-2011
What I'm asking is why do you think the number of connections in TIME_WAIT status cause the performance of the web server?

Last edited by radoulov; 01-07-2011 at 09:15 AM..
# 5  
Old 01-08-2011
asuming you do find a reason to do a change, read
Performance Tuning
It has some pointers.
Bottom line is: you can close TIME_WAIT sockets if you configure keep alive.
But I don't see a good reason in this case.
Regards
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

See AIX server remote connections

Good morning, Is there any command to view remote conxiones an AIX server? Thank you very much and best regards. (1 Reply)
Discussion started by: systemoper
1 Replies

2. UNIX for Dummies Questions & Answers

Samba server guest connections

Hi, I am trying to comprehend Samba's behaviour on one of my Arch systems and thus I'd like to ask a couple of quick questions: The setup I'd like to build is just a small home network for file-sharing using guest connections. Here it goes, 1) When using the following settings for... (4 Replies)
Discussion started by: konos5
4 Replies

3. AIX

connections on server

I am using AIX 5.3, its a application server, i am giving the support of OS & Hardware only, now i want to check how many connections are connected to my server, means how many people using my server.:confused: (4 Replies)
Discussion started by: reply.ravi
4 Replies

4. Web Development

Redirect to diff port on apache

Hi, I'm running both mail (webmail port = 8080) and web (http = 80) on same box. i am able to redirect as below without any problem. From: http://mail.abc.com To: http://www.abc.com:8080 I did the above with a simple virtualhost and redirect directive. But my requirement is to have same... (1 Reply)
Discussion started by: reddyr
1 Replies

5. Web Development

How to find number of http connections active currently in apache web server

Hi I have a solaris 9 OS with apache web server running on top of it. i want to know how many http connections are active at any point in time. (In other words how many users are accessing my website it at any moment of time) How to get it..? hit counters are not required... ----------... (0 Replies)
Discussion started by: aemunathan
0 Replies

6. UNIX and Linux Applications

Apache port has been shutdown and trying to up automatically

Hi All, Apache port has been shutdown and trying to up automatically but it wont start then after restart the service, its start. but ther is no log to identify the issue. can u pls let me know ur suggestion? (3 Replies)
Discussion started by: senor.ram
3 Replies

7. Shell Programming and Scripting

How to check if a Port is accepting connections.

Hi, I need to create a script which checks the availability of a particular service on a particular Port on HP-Unix. Is there any command in unix wherein we can check if any port is accepting the connections now. Thanks, Vihang. (5 Replies)
Discussion started by: vikings.svnit
5 Replies

8. Solaris

How to find the process that is using the port 80 and apache server.

How to find the process that is using the port 80 and apache server. When i used the command 'netstat -a|grep 80' it given that port 80 is in listening mode. I had used the following command: telnet localhost 80 GET / I had got some HTML script. But when I accessed the GUI ( url is... (7 Replies)
Discussion started by: vamshikrishnab
7 Replies

9. Shell Programming and Scripting

How do I make multiple connections to the server in this case

Given the following code #!/usr/bin/perl -w use IO::Socket; my($handle, $line, $kidpid); $handle = IO::Socket::INET->new( PeerAddr =>"64.22.229.139", PeerPort =>"4321", Proto=>"tcp", ... (0 Replies)
Discussion started by: frequency8
0 Replies

10. UNIX for Advanced & Expert Users

close_wait connections causing a server to hung

Hi Guys, Just wondering if anyone of you have been in a situation where you end up having around 100 close_wait connections and seems to me those connections are locking up resources/processes in the server so unless the server is rebooted those processes won't be released by the close_wait... (3 Replies)
Discussion started by: hariza
3 Replies
Login or Register to Ask a Question