Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Error Message!! Please help me!!
Old 03-06-2007, 07:22 PM Error Message!! Please help me!!
Junior Talker

Posts: 3
Name: sorin
Trades: 0
Hi!
I am quite inexperienced in database stuff so i will try to tell you my problem:i have a web site and i created a link to AddWord. In the same site I have also a chat program (X7v2.0)! Installation went fine, and when I accessed the links to AddWord and Chat, it worked perfectly! But then, next time (10 min later) I did the same and I got an error message (unable to connect to database). The chat program-the same, error, too many connections!!! But sometimes it works, sometimes I get these messages. I simply dont understand. My server allows 100 connection in the same time, by default...Is it from the cookie path of the chat? when I installed it, i put there './'
Simply it makes me sick of this, so i will be very grateful if i get an input from you guys!
Thx,
sorin
mandea is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-06-2007, 07:56 PM Re: Error Message!! Please help me!!
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
I hate to be obtuse but the problem is staring you right in the face. You said it already your database is limited to 100 connections and your reaching that limit. This may not be due to actual users though, it could be a rogue recursive algorithm constantly opening up new db connections when it is not necessary.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 08:03 PM Re: Error Message!! Please help me!!
Junior Talker

Posts: 3
Name: sorin
Trades: 0
Thanks Republikin! You are right, but what is to be done?? I know, for you it may sound stupid, but I do not really know what to do...shall I increase the number of maximal connections? if such an algorithm occurs, then there it will again block or? it is a mess....
mandea is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 08:09 PM Re: Error Message!! Please help me!!
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
I'm sorry if I made it sound as though your question was stupid, it is not a stupid question.

I'm not a MySQL expert but there should be some way to determine which script is accessing it the most. From there you can examine the code to see whether there is some poor programming going on. Your best bet though would be to bring this problem up with your host, make sure to communicate that you think it might be a problem with MySQL limiting connections, this way they will at least look into it for you (if they are a good host).
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 08:14 PM Re: Error Message!! Please help me!!
Junior Talker

Posts: 3
Name: sorin
Trades: 0
Thanks a lot!! Yes, I already wrote to my host...oddly, now it is working fine...i got really a nervous breakdown because i am not very familiar with this stuff, thanks anyways!!
mandea is offline
Reply With Quote
View Public Profile
 
Old 03-08-2007, 02:34 AM Re: Error Message!! Please help me!!
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Okay, what's probably going on is you're using connection pooling, and not closing some connections when you're done with them, flooding the pool. Increasing the number of allowed connections won't solve the problem, although it will come up less often. It will also slow your server down in general. Basically, don't go this route.

Even though your database server and web server are probably on the same computer, this isn't always the case, and anyway they're in different software. So the web server builds a connection to the database to be able to talk to it. Trouble is, this is really expensive - it takes a long time ( sometimes several seconds - imagine doing that over and over again to serve a page up ) and it takes up RAM on the database server. So instead of just creating these on the fly and destroying them when they aren't needed, modern applications pool database connections. When you need one, you pull it from the pool ( it's sitting there, idle, so you get it instantly - as long as one is available ) and then when you're done with it, you return it to the pool.

Most connections are open for less than a second, they just do a quick lookup and return some data, like if this is a valid login. So unless they all come in at exactly the same time, you can handle a hundred web requests with four or five database connections.

But if you don't return a connection to the pool, then another request has to build a new one, and you're one closer to your limit. So if a certain bit of code forgets to close a connection, and you hit that functino over and over, you'll slowly creep up toward that limit. On the other hand, the connections will die off after they've been idle a certain amount of time if you don't close them - they'll eventually be marked as "damaged" and cleaned up. So your flooding will go down, but very slowly, and it can go up quickly.

That's why you hit the error sometimes but not others. Or that's how connection pooling works, anyway, and it really sounds like that's your issue.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to Error Message!! Please help me!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23317 seconds with 12 queries