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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Before thinking of increasing the # of tcp connections, what about CPU load, memory, IO on the disks, etc?

If you have a loaded server, then consider expanding it or moving some load to another server.
seanostephensAuthor Commented:
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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

seanostephensAuthor Commented:
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.
Here link to performance tuning guide:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.