|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All...my website is 95% PHP driven with a mySQL connection at the top of every page. The site has been operational since earlier this year with no issues. Lately, though, my site has been erroring with a "Too many coonections open" error. This is not only happening when launching my site, but also attempting to log into my VDECK/mySQL account with iPower.com.
The first time I saw this error was last Wednesday at 2:PM Central time when I tried to test some new code. FYI: I currently do not average a lot of hits, less so at 2:PM in the afternoon on a Wednesday! I refreshed around 5-7 times and my site finally launched. I then logged into vdeck to update a table and the error occurred again. I then tried to talk to iPower and hung up after a 45 minute wait time. I periodically checked the site since and experienced the error again last night. This time, I got on the horn with iPower with a desire to hold indefinitely. NOT to my surprise, tbe level-1 could not duplicate it. He later instructed me (with the "help" of a level-2 or level-3) to "clear my browser cache" and re-try. Hmm... This morning, I received an email from a visitor showing me the same sql error she received over night. She indicated she was finally able to enter my site but only after refreshing a few times. I then contacted iPower and managed to speak to a somewhat intelligent level-1. After some convincing, he took my vdeck id and pw, signed in, then immediately received the mySQL error while attempting to log in. After further hold time, he reminded me his company was upgrading all acounts to the new VDECK system and servers. He prioritized my site's upgrade (to new VDECK version) to immediate status. But, he told me this is a common issue as a result of not properly releasing the DB. I need some help here...I don't believe it's due to my site because: 1) Every page of mine has a release statement prior to the </html> statement 2) It's been operational for almost a year with no issues 3) My highest visit rate, early November, produced my highest sales 4) Error occured trying to login to VDECK/mySQL (not just visiting my site). Please comfort me and assure me that "I see stupid people" out there (borrowed from "I see dead people")... Thanks everyone! |
|
||||
|
Why not use the new PHP PDO object ?
|
|
|||
|
I'm not sure if my webhost is PHP 5.0 able yet...
|
|
|||
|
Hey Getmea,
I had the same error message before. The site I built, (PHP) had connection statements on various pages, with close connection statements. But, for some reason the "Too many connctions" error would pop up. I fixed the problem by making the Open and Close connection statements a function. Then, just included the function call on the top of the index page and at the bottom of the index page. The site was built with all includes. So, by putting Open at the top of the index page, the function was available to all the included pages. Does that make sense? Its just a house cleaning tactic. Organization thing a ma jig. Example: <?php include ("constants.php");?> <?php include ("functions.php");?> <?php fnOpenDBConnection(); ?> <html> <head> </head> <table width="100%" cellpadding="0" cellspacing="0" height="100%" class=""> <tr valign="top"> <td align="center" valign="top" height="181"> <?php include ("includes/incHeader.php"); ?></td> </tr> <tr> <td> <table cellpadding="0" cellspacing="0" width="100%" height="100%" class=""> <tr> <td align="center" valign="top"> <?php include ("includes/incMainbody.php"); ?></td> </tr> <tr> <td align="center" height="40"> <?php include ("includes/incFooter.php"); ?></td> </tr> </table> </td> </tr> </table> </body> <?php fnCloseDBConnection(); ?> </html> Peace out Giziis |
|
|||
|
jermooski:
I have something similar on EVERY page. I have a mysql_conenct string at the top and a mysql_close at the bottom. wige: Yes, most likely it is a shared server (I am not paying any extra for a single-domain server). I, too, suspect that maybe some other domain on my server is hogging the sql resources, but I don't have access to the logs (or even know how to get to them). My fist suspicion was when I attempted to manually login to mySQL to do some housekeeping and the error appeared. No reply yet from my web host... |
|
|||
|
Ask your host(if you can get in touch with them)
To see if they will increase the connections limit in the mysql config file. Most won't, but can't hurt to ask. Ipower likes to over-sell their servers, so consequently, the more sites using mysql on a server, the more likely this is to happen
__________________
----Don't Call Me Brian---- |
|
|||
|
thanks...will try contacting the host tonite...
|
|
||||
|
Than you should aske your hoster to upgrade the sooner than later. Using the Database object has the following advenatges:
|
|
|||
|
I've read up on PHP 5; it has many advantages including being OOP. Sort of reminds me of Java, though
I'll recommend the upgrade to my web host. thanks |
|
||||
|
mySQL Too Many Connections Open error
That is a typical feature with the old model. If you use the PDO object, you can use the prepare and execute methods that may be all you need to solve the problem. If not, you combine it with exception handling as indicated above. Good OO code generally and PHP code especially always use exception handling to test for timeout, server down, broken links etc etc.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started Last edited by kgun; 12-14-2007 at 08:33 AM. |
|
|||
|
I can put in exception handling until the cows come home...but it won't fix the "too many connections open" issues...it will only trap it.
If I can't establish a connection and run queries, I don't have any products to show on my site. Mind as well shut down. I tried to talk to the web host again yesterday (twice) but hung up after 55 minutes of holding. |
|
||||
|
Time to switch hosting perhaps...
Shouldn't take more than an hour to switch to another hosting service (and 24 hours for the DNS change to propagate). I'm sure you can find hosting locally, but if you want me to set you up on mine, drop me an email - david@activeminds.ca |
|
|||
|
Finally got an answer from the web host. It appears they took my advice and looked at logs (imagine that!). They found a blog web site on my same server which had been hogging a lot of mySQL connections. They're opinion is this sort of web site should be on a dedicated server. So they suspended the site.
According to their estimates, 200 connections and 50,000 queries are the max per hour. I'm not sure if these are at a "per server" or "per web site" threshold. I'm up and running now... thanks all for your suggestions! Getmea |
|
||||
|
Quote:
|
|
||||
|
Quote:
I have three different hosters.
|
|
||||
|
Quote:
I do however have just enough control to setup hosting without having to contact anyone else. The servers are in a collocation centre on the internet backbone for performance reasons. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DW and DB connections? | ackerley1 | Database Discussion Forum | 4 | 03-31-2006 12:30 PM |
| Runtime Error - Line 1 - Error Syntex Error | charms987 | Graphics & Design Discussion Forum | 6 | 07-29-2005 12:56 PM |
| Server Error 500 on PHP/MySQL site | MarcieZoob | Web Programming Discussion Forum | 6 | 07-17-2005 07:02 AM |
| How to view the current connections? | MELjiip | Internet Security Discussion Forum | 4 | 12-23-2004 12:32 AM |
| Script Time Out Error with MySql Database | printas | Database Discussion Forum | 1 | 05-04-2004 01:31 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |