Sporadic database connection issue

Hey All,

On our production server, which gets quite a few visits, there is a problem where, at times, we get cannot connect to database. I have upped the my.cnf files thresholds for the number of connections and such but we continue to get this error. The resources on the server are not being pushed to the extreme, so that isn't it either.

The error:
An Error was Encountered
Unable to connect to your database server using the provided settings

(the generic CI error)

Has anyone run into this problem before or have ideas on how we can tweak in order to stop this?

Thank you for your time and help,

If you use a persistent connection , then in database config file set it to false . It might be because of the persistent connection .

I thought about that but I really don't believe that is the problem. Here is why: this can happen at anytime of the day: high load, low load, etc. Also, it usually happens on the first page of the site, so it is happening from the beginning of the loading of the page. I have had it where most of the page has loaded, then there is an ajax call, and in the return the div that holds the return, that same error. I haven't been able to duplicate the error for testing purposes.

Also, per my post, I thought changing the my.cnf values would fix the problem. Obviously not.

Try disabling thee Ajax call to see if it is causing the problem!

You have already tracked it down to the first loading page so that
is where the problem must be or you have a bad database or server.


[quote author="InsiteFX" date="1272619853"]Try disabling thee Ajax call to see if it is causing the problem![/quote]

Maybe I wasn't clear on this: sometimes the page will load fine, sometimes the page will load w/ the error, sometimes part of the page will load and then other calls to the server will time out. It is very sporadic on which pages it will happen and, in some cases, which part of the page.

Well there is a problem there so you need to take things out to track it down right!
Unable to connect to database is telling me a database server problem!
It could also be a memory problem!

Turn on database debug feature in database config.
Then check your server log files, check the CI log files.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.