Author Topic: Too many connections Error  (Read 7165 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Too many connections Error
« on: April 11, 2006, 12:24:49 AM »
Hi every one
I just got an error that said Too many connections
so i read about that error
and i saw that the default max_connections on the my.cnf file was 100
so i went there i change that variable max_connections to 300
but im a newbie in all this stuff, I have my on dedicated server
so my questions are do you think this is too much?
do you have any advice for me in this topic?

Thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Too many connections Error
« Reply #1 on: April 11, 2006, 01:09:19 AM »
actualy, the problem is not in how many connections mysql allowed, but how much is the timeout for idlle connections...I'm still not sure how PHP communicates with mysql and why it leaves idlle processes after each connection, perhaps its mysql fault, I dont know, but in my case, I've solved this problem by changing wait_timeout setting in my.cnf
although, I just double checked mysql manual and it says that setting only affects TCP/IP connections and not socket-type connections...yet, I'm using socket type, so I dont know...

anyways, try it yourself and see if it helps, also, you might want to check this page:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

P.S.
you can compare how many idlle connections and how long they where idlle from phpmyadmin before and after this change ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Too many connections Error
« Reply #2 on: April 12, 2006, 09:12:36 PM »
Thank you I made those changes but im still getting an error:

DB Error: Could not connect to the database server (localhost, jaimeascanio).

so i went to the bash i typed apachectl restart and i the site was working again

and this how my my.cnf looks like



do i need to restart something to make the changes?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Too many connections Error
« Reply #3 on: April 13, 2006, 12:30:30 AM »
yes, you need restart mysql server
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Too many connections Error
« Reply #4 on: April 13, 2006, 12:37:11 AM »
do you know the command to do that?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Too many connections Error
« Reply #5 on: April 13, 2006, 12:59:32 AM »
mmmm.....I dont know what system do you use, on FC4 I use
/etc/rc.d/init.d/mysql restart
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Too many connections Error
« Reply #6 on: April 13, 2006, 05:42:58 AM »
I have fedora code
i used that i got this
Code: [Select]
[root@...... tmp]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:  [FAILED]
[root@bigboy tmp]#
i also used
Code: [Select]
service mysqld restart and i got the same errorso i went back to my file my.cfn and i removed the changes that i made and i restart again and it worked but i didn't have any speling errors
so im not allow to make chages in that file?  :?

Offline kief24

  • Sr. Member
  • ****
  • Posts: 267
    • View Profile
Re: Too many connections Error
« Reply #7 on: April 13, 2006, 10:20:43 AM »
hello,

i somethimes have the problem my pages doesn't load for 20-30 sec. Then i get the error " server not found".
After some sec, all works fine again.
I think this could have to do something with the timeout time for idle connections.

In my my.cnf file i dont find any "wait_timeout" line.....

I only see
Code: [Select]
edited
XXXXXXXXXXXX

should i add "wait_timeout=30 " ?

thx
« Last Edit: April 13, 2006, 03:51:36 PM by kief24 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Too many connections Error
« Reply #8 on: April 13, 2006, 02:44:27 PM »
yes
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)