Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Database Connections - Too many of them!


pafranklin

Recommended Posts

Hi there, sorry for yet another support request, but I have a problem when using both the admin and customer areas of the site.

 

My host has a limit of 90 concurrent database connections and for some reason just a few clicks around the admin and customer areas seems to generate more than this number (which means I get automatically blocked from the server for two hours). I have used a program called cPorts to monitor this and confirm that four clicks seem to generate a large volume of separate connections which is causing the problem.

 

I have absolutely no idea what is going wrong here and would be VERY grateful for some help please????

 

Thank you.

 

Paul

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Hi there, sorry for yet another support request, but I have a problem when using both the admin and customer areas of the site.

 

My host has a limit of 90 concurrent database connections and for some reason just a few clicks around the admin and customer areas seems to generate more than this number (which means I get automatically blocked from the server for two hours). I have used a program called cPorts to monitor this and confirm that four clicks seem to generate a large volume of separate connections which is causing the problem.

 

I have absolutely no idea what is going wrong here and would be VERY grateful for some help please????

 

Thank you.

 

Paul

 

Do you have

 

define('USE_PCONNECT', 'true');

 

In both configure.php?

Link to comment
Share on other sites

Do you have

 

define('USE_PCONNECT', 'true');

 

In both configure.php?

Hi and thanks for the reply.

 

My two configure.php files have

 

define('USE_PCONNECT', 'false');

 

Is this correct or should I change to True?

 

Many thanks Paul.

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Hi and thanks for the reply.

 

My two configure.php files have

 

define('USE_PCONNECT', 'false');

 

Is this correct or should I change to True?

 

Many thanks Paul.

 

No it should be false.

Link to comment
Share on other sites

installed any contributions lately, or made other code changes?

 

-jared

No, Nothing installed particularly recently. I have read up a lot about persistent connections and wonder what would be the imact of changing to "true" in the configure.php files to set up a persistent Mysql connection on my shared host?

 

Other than that I am at a loss. The trouble is if I start to print orders, add a cuple or products and do any basic work, the volume of connections grows to in excess of 90 quickly and I get blocked from access for two hours.

 

Help........... :-(

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

In between pulling your hair out and looking for a decent host if you find the time at the end of footer.php add

 

mysql_close();

Link to comment
Share on other sites

In between pulling your hair out and looking for a decent host if you find the time at the end of footer.php add

 

mysql_close();

Hi and thank you for taking the time and trouble to reply. It is much appreciated.

 

I needed to change this to

<?php mysql_close(); ?>

at the end of my footer.php page.

 

Unfortunately it did not make any difference. Opening my index.php page generated 29 database connections and just two page refreshes made this figure jump to 45 seperate database connections.

 

Now hairless and dreading the thought of having to move host (after only moving to these three months ago). I simply do not know what else to try, but thank you for trying to help!

 

Best regards.

 

Paul

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Not sure if it'll work in your particular .htaccess but try ..

 

php_value mysql.connect_timeout 20

 

Reducing this from the default 60 secs may prevent sleeping threads accumulating.

Link to comment
Share on other sites

Not sure if it'll work in your particular .htaccess but try ..

 

php_value mysql.connect_timeout 20

 

Reducing this from the default 60 secs may prevent sleeping threads accumulating.

 

Thank you yet again (I seem to be saying that a lot lately)!!

 

Sorry for being a little simple but should this go in the .htaccess file or in the footer.php as before?

 

Many thanks.

 

Paul

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Thank you yet again (I seem to be saying that a lot lately)!!

 

Sorry for being a little simple but should this go in the .htaccess file or in the footer.php as before?

 

Many thanks.

 

Paul

 

catalog/.htaccess

Link to comment
Share on other sites

a lot of this is also a host problem, on their shared servers.

 

Yeah, I'm pretty sure its virtually ALL related to a host problem and a badly resourced shared server.

Link to comment
Share on other sites

  • 1 month later...

Robert.

Did you ever find a solution to this?

 

Regards,

 

Heath.

Experienced in MySQL and PHP. I am always willing to help if you require a quick answer but please note that any work I do for you has to be charged for and pre-paid via PayPal. Sorry but I spend so much time helping others that I have less time for my own business. Please only ask for my assistance if you are willing to pay for my time.

Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...

I have the same problem hosting on NetRegistry through hostess.com.au - they keep pointing to a programming problem on my end, but most PHP references indicate that if you mysql_open() without a new link, it should reuse existing links (if any, by default) and at the end of the php, it should close the link automatically - so this looks like a problem with the hosting's garbage collection... Regardless I've added mysql_close() to the application_bottom.php but can't test it until the DB is bounced.

 

I'm now offline for 19 hours, and I'm not a happy camper...

 

MikeG

www.bestexhaust.com.au

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...