MyEmails
Nov 24 2003, 06:09 AM
My site uses Createasite4u scripts. Despite all I've heard, I really have no complaints with them. I did upgrade to the latest version this past week, and my host (Go Mama: love 'em!) has let me know the site has been overloading the cpu of the server since then. I turned off practically everything (paid clicks, paid start page, etc.) so that the site would remain open and I would still have contact with my members. All was ok for a bit.
I turned on the Paid Clicks, and everything was still ok. Yesterday, I turned back on the paid start to signup page (I figure it shouldn't cause much trouble), and everything else except the traffic exchange, inbox, and paid start page. I did send a few emails. I got word from Go Mama that the server use climbed, and that they are seeing 'constant connections to the MySql."
I've contacted Createasite4u and also a few webmasters who are also on the new version and I am the only one experiencing this. (I understand that there are now over 60 sites on the new version, 20ish hosted with Createasite4U.) Can anyone 1) tell me what it means that there are too many connections to the MySql and 2) what might be causing the overload? I really don't know enough about programming, MySql, etc. for this to make sense.
Any help would be appreciated!!
Marie
starsol
Nov 24 2003, 11:09 AM
Whenver a script connects to MySQL, make certain the script closes the connection rather than letting it time out. This is done in PHP with the function:
freeandeasy
Nov 24 2003, 12:46 PM
| QUOTE (starsol @ Nov 24 2003, 11:09 AM) |
Whenver a script connects to MySQL, make certain the script closes the connection rather than letting it time out. This is done in PHP with the function:
|
Where do you put that code?
Eliminator
Nov 24 2003, 01:48 PM
lol .. the starsol just posted what code we need to close a connection
but he failed to mention a lot
we need link identifier as the argument
mysql_close(link identifier);
and its not easy to do because the script may have mysqlconnections ar different places.. if not its easy ..
but mostly at footer.php or end of pages like
mysql_close($con);
if $con is used at start to connect.. explore the codes you can find it easily . it wil be like
$con = mysql_connect(..)
cs4u scripts had a problem in past with this.. but i dont think the newest versions have same problem
this problem you have is customized for you lol.. better contact the programmers of cs4u .
freeandeasy
Nov 24 2003, 02:58 PM
| QUOTE (Eliminator @ Nov 24 2003, 01:48 PM) |
lol .. the starsol just posted what code we need to close a connection but he failed to mention a lot we need link identifier as the argument
mysql_close(link identifier);
and its not easy to do because the script may have mysqlconnections ar different places.. if not its easy ..
but mostly at footer.php or end of pages like
mysql_close($con);
if $con is used at start to connect.. explore the codes you can find it easily . it wil be like $con = mysql_connect(..)
cs4u scripts had a problem in past with this.. but i dont think the newest versions have same problem
this problem you have is customized for you lol.. better contact the programmers of cs4u . |
Well that was clear as mud to my muzzy mind.......
SelfSupportiveSolutions
Nov 24 2003, 03:50 PM
Seems like a dangerous modification to be making for us novices who don't really know what we're doing with PHP/mysql.
starsol
Nov 25 2003, 03:54 AM
Yep, sorry I was a bit brief there

.
I'm not sure what effect putting the PHP function to close a MySQL connecton at the very bottom of footer.php would do - I think it would at very worst just show up as an error on the final output HTML (and that would only be if the connection had already been closed).
I'd advise try doing what Eliminator said, and if that doesn't work, you could try asking the person who wrote the script what could be causing this.
Eliminator
Nov 25 2003, 04:46 AM
| QUOTE (freeandeasy @ Nov 25 2003, 04:58 AM) |
| QUOTE (Eliminator @ Nov 24 2003, 01:48 PM) | lol .. the starsol just posted what code we need to close a connection but he failed to mention a lot we need link identifier as the argument
mysql_close(link identifier);
and its not easy to do because the script may have mysqlconnections ar different places.. if not its easy ..
but mostly at footer.php or end of pages like
mysql_close($con);
if $con is used at start to connect.. explore the codes you can find it easily . it wil be like $con = mysql_connect(..)
cs4u scripts had a problem in past with this.. but i dont think the newest versions have same problem
this problem you have is customized for you lol.. better contact the programmers of cs4u . |
Well that was clear as mud to my muzzy mind....... |
the is how the programmers usually connect to mysql
$con = mysql_connect($dbhost,$username,$password);
// here $con is the link identifier
and this command is usually placed in end of configfile may be (config.php) or at the start of phpfile where all the functions are dumped
maybe cs4u programmer forgot to close the connection at end of php this is usual to programmers lol.
so
mysql_close($con);
//$con should be replaced withlink identifier..
this command should be add to a place at the end after which there is no mysql connection
thats why i said footer.php
footer.php is not the exact file.. it may be lol..
i should see the script to correct it .. better the programmer of script can correct it easily
Eliminator
Nov 25 2003, 04:48 AM
| QUOTE (SelfSupportiveSolutions @ Nov 25 2003, 05:50 AM) |
Seems like a dangerous modification to be making for us novices who don't really know what we're doing with PHP/mysql. |
yes be carefull when editing phps..
then your site may be showing parse errors instead of index page..
freeandeasy
Nov 25 2003, 07:51 AM
| QUOTE (Eliminator @ Nov 25 2003, 04:48 AM) |
yes be carefull when editing phps.. then your site may be showing parse errors instead of index page.. |
Oh, believe me, I already learned that the hard way a while back...
freeandeasy
Nov 25 2003, 07:53 AM
| QUOTE (Eliminator @ Nov 25 2003, 04:46 AM) |
| QUOTE (freeandeasy @ Nov 25 2003, 04:58 AM) | | QUOTE (Eliminator @ Nov 24 2003, 01:48 PM) | lol .. the starsol just posted what code we need to close? a connection but he failed to mention a lot we need link identifier as the argument
mysql_close(link identifier);
and its not easy to do because the script may have mysqlconnections ar different places.. if not its easy ..
but mostly at footer.php or end of pages like
mysql_close($con);
if $con is used at start to connect.. explore the codes you can find it easily . it wil be like $con = mysql_connect(..)
cs4u scripts had a problem in past with this.. but i dont think the newest versions have same problem
this problem you have is customized for you lol.. better contact the programmers of cs4u . |
Well that was clear as mud to my muzzy mind....... |
the is how the programmers usually connect to mysql
$con = mysql_connect($dbhost,$username,$password); // here $con is the link identifier
and this command is usually placed in end of configfile may be (config.php) or at the start of phpfile where all the functions are dumped
maybe cs4u programmer forgot to close the connection at end of php this is usual to programmers lol.
so
mysql_close($con); //$con should be replaced withlink identifier..
this command should be add to a place at the end after which there is no mysql connection
thats why i said footer.php footer.php is not the exact file.. it may be lol..
i should see the script to correct it .. better the programmer of script can correct it easily
|
Now I understand.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.