seanostephens
asked on
TCP Connections and System Responsiveness.
Hi Experts,
My questions relate to linux tcp connections and the responsiveness of programs that reqiure them. Let me lay the background.
We have a webserver, (its extreemly busy, runs about 30-40 sites, most of which receive thousands of visitors a day). It runs a CGI language called lasso, (similar to php). From that CGI we have created a content management system for those 30-40 sites, which is fairly database entinsive. It runs about 10-15 queries to load 1 simple page. More intense pages could be between 50-100 database queries per page.
Now that CGI has a database connector which it uses to connect to MySQL. To do that it creates a TCP connection on a specific port, doing a netstat on the server will show all active connections.
We are having major stability problems at this point and I want to understand why this is happening and whos problem it is.
What happens is suddenly the server stops accepting incoming connections to the CGI, and therefore stops serving our websites. If we do a netstat at this point we see hundreds of connections for a whole bunch of different programs, the CGI language being 1, but also apache and mysql sometimes as well. Restarting any one of these programs to free up those TCP connections allows for the server to start serving the websites again.
What I am wondering is, can I increase the Max # of tcp connections, and would this help my cause? Is this safe to do? How do I go about doing it?
Any ideas or insight are greatly appreciated.
Thanks for your time.
My questions relate to linux tcp connections and the responsiveness of programs that reqiure them. Let me lay the background.
We have a webserver, (its extreemly busy, runs about 30-40 sites, most of which receive thousands of visitors a day). It runs a CGI language called lasso, (similar to php). From that CGI we have created a content management system for those 30-40 sites, which is fairly database entinsive. It runs about 10-15 queries to load 1 simple page. More intense pages could be between 50-100 database queries per page.
Now that CGI has a database connector which it uses to connect to MySQL. To do that it creates a TCP connection on a specific port, doing a netstat on the server will show all active connections.
We are having major stability problems at this point and I want to understand why this is happening and whos problem it is.
What happens is suddenly the server stops accepting incoming connections to the CGI, and therefore stops serving our websites. If we do a netstat at this point we see hundreds of connections for a whole bunch of different programs, the CGI language being 1, but also apache and mysql sometimes as well. Restarting any one of these programs to free up those TCP connections allows for the server to start serving the websites again.
What I am wondering is, can I increase the Max # of tcp connections, and would this help my cause? Is this safe to do? How do I go about doing it?
Any ideas or insight are greatly appreciated.
Thanks for your time.
ASKER
CPU, memory and disk usage are nil, during the times when the server isn't responsive because it isn't accepting connections to do anything. The only processes are happening are internal ones.
So try to increase the max and see if it improves
ASKER
Omarfarid, Thanks for your comments. I am running RedHat EL 4.4. How would I go about doing that? I suppose I would need to rebuild the kernel? Would there be any performace detriments to doing so? Is there something else that could be causing the symptoms I describe?
Thanks again.
Thanks again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
If you have a loaded server, then consider expanding it or moving some load to another server.