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.