Hi all,
I'm new to the forum and thought I'd see if anyone out there would be willing to help.
We set up a new site which has about 1000 php scripts that run using about 89 fopen scripts which open multiple php scripts. We've had some server crashing issues and I think it's because the memory usage and swap gradually increase. We had sleep() in our fopen scripts and have removed that as apparently it was using up resources.
When looking at top using SSH, the mysql connection shows like this:
11292 mysql 20 0 3217m 715m 4596 S 0.7 18.7 79:51.52 mysqld
Although 18.7 is not too high right now, you can see that it's been open for almost 80 hours. How do I go about closing this process? Our webhosting technical support told us that it is probably something in our code that is keeping it open. But since we're using mysql_query($result) with a persistent connection, shouldn't it be closing automatically at the end of the script? The only thing I can think of is that the with our fopen scripts, we're not using the fclose, which should technically close out anyway no?
If anyone can provide input, I'd greatly appreciate it. This has been a HUGE headache for us and we're looking to have this resolved as soon as possible!
We have a quad core dedicated system with 4gb of ram. Each cron script takes typically no longer than 30 seconds to run.
I'm new to the forum and thought I'd see if anyone out there would be willing to help.
We set up a new site which has about 1000 php scripts that run using about 89 fopen scripts which open multiple php scripts. We've had some server crashing issues and I think it's because the memory usage and swap gradually increase. We had sleep() in our fopen scripts and have removed that as apparently it was using up resources.
When looking at top using SSH, the mysql connection shows like this:
11292 mysql 20 0 3217m 715m 4596 S 0.7 18.7 79:51.52 mysqld
Although 18.7 is not too high right now, you can see that it's been open for almost 80 hours. How do I go about closing this process? Our webhosting technical support told us that it is probably something in our code that is keeping it open. But since we're using mysql_query($result) with a persistent connection, shouldn't it be closing automatically at the end of the script? The only thing I can think of is that the with our fopen scripts, we're not using the fclose, which should technically close out anyway no?
If anyone can provide input, I'd greatly appreciate it. This has been a HUGE headache for us and we're looking to have this resolved as soon as possible!
We have a quad core dedicated system with 4gb of ram. Each cron script takes typically no longer than 30 seconds to run.
Last edited: