Crushing MySQL with traffic / queries???? questions!

Discussion in 'Site & Server Administration' started by admin@suckered.us, Aug 24, 2007.

Thread Status:
Not open for further replies.
  1. #1
    What can be done if you're overpowering a dual xeon with 4gb of ram by so much traffic it's literally killing mysql? How much can you actually tweak it? We're talking a single database killing an entire server from traffic overload.

    What are methods / ways that are semi affordable for solutions ?
     
    admin@suckered.us, Aug 24, 2007 IP
  2. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Spilt your MySQL on another server through private network :)
     
    tanfwc, Aug 24, 2007 IP
  3. admin@suckered.us

    admin@suckered.us Banned

    Messages:
    670
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah that's what I've been told.. I'm looking at around 1k per month for that setup with load balancer but I trust the company... Guess it costs money to make money!
     
    admin@suckered.us, Aug 24, 2007 IP
  4. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can do without load balancer as you only have 1 web server & 1 db server :)
     
    tanfwc, Aug 24, 2007 IP
  5. plumsauce

    plumsauce Peon

    Messages:
    310
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you should probably take a look at the code first to determine if it is well written, and take a look at the database design/implementation.
     
    plumsauce, Aug 24, 2007 IP
  6. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Are you serving pages with or without gzip compression? If the pages are currently uncompressed, using gzip will reduce in drastic bandwidth reduction. You can check performance gain for any page at http://www.gidnetwork.com/tools/gzip-test.php

    To reduce load on Mysql, implement a cache in php to serve pages without mysql lookup.
     
    Kuldeep1952, Aug 25, 2007 IP
  7. ndreamer

    ndreamer Guest

    Messages:
    339
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    optimize your code where possible first maybe page caching or sql query catching it's very easy and cheap to get some of your processor back this way.
     
    ndreamer, Aug 25, 2007 IP
  8. admin@suckered.us

    admin@suckered.us Banned

    Messages:
    670
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yes Trying php caching first. Also using Gzip yes.. Bandwidth is not an issue. It's the massive queries.
     
    admin@suckered.us, Aug 25, 2007 IP
  9. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #9
    As suggested above, you probably don't need a load balancer at this point
    Just 2 servers, one for static and the other mysql.

    Have you done any optimization of mysql's config.
    That would be the first place I would look
     
    cyanide, Aug 25, 2007 IP
  10. admin@suckered.us

    admin@suckered.us Banned

    Messages:
    670
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Well I'm breaking 60,000 uniques today and around 500,000 pageviews as we speak. Not sure but it's only going up.
     
    admin@suckered.us, Aug 25, 2007 IP
  11. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #11
    How big is your database? If you can manage to have it smaller in size than the available RAM, either by increasing RAM, or by deleting and optimising the database, you should be able to serve Select queries without having to read the tables from Disk. This should give you a quantum jump in performance.
     
    Kuldeep1952, Aug 26, 2007 IP
  12. linsys

    linsys Peon

    Messages:
    274
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #12
    There are a lot of answers to this question.

    1) HOW is mysql killing the server? Memory? CPU? DISK?

    2) A lot of database problems are caused by disk and "hot spots"

    3) You don't need a load balancer for a separate mysql server simply move the database to another dedicated server and change the php conf info to point to this external mysql server

    4) Make sure all your mysql databases are indexed

    at 60,000 queries per day that isn't that much, I run an auto-dialers that make over 300,000 queries to a database that has over 3million records each day, but the database is highly tuned and the auto-dialer and mysql server sit on the same box..

    It all depends on what the DB is serving up etc..
     
    linsys, Aug 27, 2007 IP
Thread Status:
Not open for further replies.