cdhowie / Bitcoin-mining-proxy

Multi-pool, multi-worker proxy for Bitcoin miners, supporting long polling and pool failover
GNU Affero General Public License v3.0
126 stars 70 forks source link

'SQLSTATE[HY000] [1040] Too many connections' #41

Open weeb0 opened 13 years ago

weeb0 commented 13 years ago

After few hours, I cannot connect to the proxy, in apache error_log, I see the following message :

[Thu Jul 28 20:17:37 2011] [error] [client 192.168.0.XXX] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1040] Too many connections' in common.inc.php:33\nStack trace:\n#0 common.inc.php(33): PDO->__construct('mysql:host=loca...', 'bitcoin_proxy', '741369')\n#1 index.php(31): db_connect()\n#2 {main}\n thrown in common.inc.php on line 33

Obsi commented 13 years ago

I had to tweak my.cnf for similar reasons. If I recall, I dropped wait_timeout to 120 and upped max_connections to a few thousand. I had noticed quite a few stale connections just hanging around, so you might get by with just setting the timeout to something decent.