Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
30.0k views
in Q2A Core by
[23-Dec-2010 18:22:03] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User db_admin already has more than 'max_user_connections' active connections in /home/public_html/qa-include/qa-db.php on line 50

2 Answers

+1 vote
by
I don't think so. I think it can happen if too many pages are requested from your Q2A system at the same time, presumably by multiple users and/or search engines. But if this happens often it might be worth checking into in more detail.
by
yeah, traffic was bit high. If it appears again then will let you know.
0 votes
by
yesterday again I got this error when users were more than 100 at a time on the site. why it should happen?
by
Here is reply which I got from the bluehost customer support team

-----------
On our system, the maximum amount of concurrent connections that a single user can have open is 15. It seems as though your connections are either staying open too long, or the queries that run in those connection are taking too long to execute. I would recommend two things:
1. Looking through your MySQL Slow Queries. This will show you specifically where (if any), query problems exist. The MySQL Slow Query logs can be found in ~/tmp/mysql_slow_queries you can access them via FTP or in the File Manager on your cPanel.

2. Implementing a caching system. On most database driven sites, the database is queried multiple times on every page load to return data. The majority of these queries are returning the same information time after time. A caching system will store the information returned from your database and use it for a set period of time without querying the database again. Not only will this cut down by a long ways on MySQL connections, it will also make your site load much faster since MySQL is not as involved.
------------------
by
There could be an issue that pages are taking a long time to generate, so that the database connection for each page view is open a long time, leading to high concurrent connections.

You can find out more by changing this line in your qa-config.php file:

define('QA_DEBUG_PERFORMANCE', false);

... to ...

define('QA_DEBUG_PERFORMANCE', $_SERVER['HTTP_HOST']=='1.2.3.4');

Replace 1.2.3.4 with your IP address, which you can find out from www.whatismyip.com. Now as you browse your site, you will see information at the bottom of the page showing how long it took to generate each page, and how that is broken up into different stages and types of operation. Have a look and see if one thing really dominates the processing time.
by
Gideon, Thanks for the suggestion. will do this experiment to find out root cause.

I feel, just a 15 connections is a bottle neck.
by
It could be the timeout. On my server reducing the timeout on Apache connections got rid of lag, maybe the same theory works for MySQL. It's possible all connections to the site are staying around for too long after being opened and not being able to be used by others.
...