Wordpress Datatabase connection problems

Discussion in 'WordPress' started by mmmaster, Nov 7, 2011.

  1. #1
    Hello, I've been running a wordpress site very smoothly for the past year or so. But I always have the same problem during traffic spikes (more than say 1k people coming at the site at the same time) It's very hard for the page to load, the server is already configured to take such load, and at first I taught it was a server issue. But a message shows up saying "Wordpress could not connect to database" or a simple "Error establishing database connection"

    Once again, this only happens during traffic spikes. The WP-Config file is configure just fine with the right user, password , and "localhost"

    All tips are appreciated as this is very frustrating:mad::mad:!


    Thanks
     
    mmmaster, Nov 7, 2011 IP
  2. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #2
    You could try deleting the themes you do not use out of wp-content/themes and also deleting any inactive plugins.

    Then, there is page caching. How often do you update?
     
    adbox, Nov 8, 2011 IP
  3. Ahsanaveed

    Ahsanaveed Peon

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This happens when your bandwidth bursts out. It means you have consumed your monthly assigned bandwidth.
     
    Ahsanaveed, Nov 9, 2011 IP
  4. bekar09

    bekar09 Active Member

    Messages:
    283
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Unusual problem. Subscribing to see what others have to say about this issue.
     
    bekar09, Nov 10, 2011 IP
  5. brotsky

    brotsky Member

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    I recently had the same problem with some of my larger sites a while back. MySQL (your databases) take the most processing power on your server so it is the first to crash. The solution that fixed my problem was getting a RAM upgrade and later I upgraded to a database server to manage only my MySQL databases. I have an i5 with 16GB of RAM on the web server and an i7 with 16GB of RAM on my database server. Database servers are usually better than your web server.

    Other solutions to reduce your load that are a little bit more affordable are:
    1. Using a CDN. Check out MaxCDN.com or Amazon's CloudFront (won't cost you toooooo much compared to what you are already paying for your dedicated server)
    2. CloudFlare.com (FREE or $20/month for premium)
    3. WP Super Cache (FREE)
    4. I have also heard great things about JetPack, it uses WordPress.com's Cloud Hosting with your self-hosted WordPress site. Check out JetPack.me. (FREE)

    Hope this helped :)
     
    brotsky, Nov 12, 2011 IP
  6. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    He is right. You need to upgrade your RAM to solve this issue. Instead of WP Super Cache, I will suggest to use Hyper Cache. But never use W3 Total Cache.
     
    тнє Sufi, Nov 13, 2011 IP
  7. samirj09

    samirj09 Well-Known Member

    Messages:
    335
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    125
    #7
    Why never user w3 total cache?
     
    samirj09, Nov 13, 2011 IP
  8. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It creates a heavy load on the server!
     
    тнє Sufi, Nov 13, 2011 IP
  9. bekar09

    bekar09 Active Member

    Messages:
    283
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #9
    can you give some evidence supporting your statement please?
     
    bekar09, Nov 14, 2011 IP
  10. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I am the evidence of it. I had used W3 total cache in my VPS to make my WP site faster. But it was consuming heavy RAM in my VPS. So I decided to test it in some other server, and found the same result. It saves site loding time, but it increasing RAM usage. So if you have good number of visitors, you will face problems is shared or low level VPS servers.
     
    тнє Sufi, Nov 14, 2011 IP
  11. ilook

    ilook Well-Known Member

    Messages:
    1,602
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    165
    #11
    If you host with Hostgator then YES i experience the same damn issue as well a LOT!!!
    That means i do NOT recommend Hostgator (of course!).
     
    ilook, Nov 14, 2011 IP
  12. bekar09

    bekar09 Active Member

    Messages:
    283
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #12
    Well did you report this to the plugin authors? I never noticed this issue on my shared hosting.
     
    bekar09, Nov 14, 2011 IP
  13. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    No I did not report
     
    тнє Sufi, Nov 15, 2011 IP