Error establishing database connection, but the server hasn't crashed

Discussion in 'Site & Server Administration' started by Khaludi92, Jun 27, 2012.

  1. #1
    Hi,

    I am running a wordpress site on a dedicated server. During peak timings, My site becomes inaccessible and shows the error "Error establishing database connection".

    While the site shows the respective error, I can still access the cpanel and everything on the cpanel side runs smooth.

    What should I do ? Is there anyone who can help me optimize my server to the max ? I am ready to pay for the job.
     
    Khaludi92, Jun 27, 2012 IP
  2. BMR777

    BMR777 Well-Known Member

    Messages:
    145
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    140
    #2
    When this happens, what is your load on the server like? It's possible that MySQL is crashing but it's not enough to bring the whole box down. When this happens, can you check that the MySQL service is running? What about restarting the service in CPanel?

    The CPanel will continue to function properly even if MySQL crashes. I believe it is isolated from the main Apache process as well so it will continue to work if that goes down too. Only a full blown server crash would take down the CPanel, requiring a reboot.

    You should also check the slow query log and see if something is bogging things down that your site can't handle when it gets peak traffic: http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html
     
    BMR777, Jun 27, 2012 IP
  3. Hostwinds_Dan

    Hostwinds_Dan Active Member

    Messages:
    149
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    If your dedicated server's SQL is crashing from one WordPress site it is really time to get a new server. I'm more than willing to help you out on that, my friend!

    Feel free to add me on Skype and we'll talk about this issue. Having a site that is inaccessible during your most profitable / popular time is absolutely unacceptable.

    Skype: Hostwinds.Daniel
     
    Hostwinds_Dan, Jun 29, 2012 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    Hello there,

    If you need someone to look at this issue, and optimize your server, please PM me.

    Regards,
    Chris
     
    RHS-Chris, Jun 29, 2012 IP
  5. linux7802

    linux7802 Active Member

    Messages:
    110
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5

    The error message you are receiving because your dedicated server reached the maximium allowed mysql connection to the server, you can check the mysql maximum connection limit by using the following command from the shell and increase it as per your requirement.

    mysqladmin variable | grep -i max_connections

    But before increasing the mysql maximum connection limit run the mysql tunner on your server to optimize the mysql on your server, it will provide you the correct settings which you can add under the /etc/my.cnf file.

    If you are not sure about mysql tunner tool than you can search the option "Mysql tuner to tune mysql service" in google, it will provide you step by step solution to configure and run the mysql tunner on your server.
     
    linux7802, Jun 29, 2012 IP
  6. djacobs

    djacobs Well-Known Member

    Messages:
    238
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    140
    #6
    No that does not mean he needs a new so don't make assumptions. He needs to optimize his server, MySQL, and script. Upgrading hardware is the quick and expensive way, which will lead to him constantly upgrading hardware frequently for no valid reason.
     
    djacobs, Jun 30, 2012 IP