Optimizing My.CNF for a large forum wth a large database help

Discussion in 'MySQL' started by CoolDude105, Aug 24, 2011.

  1. #1
    Hello, I run a site that has a large database (~7GB).

    I've been constantly looking for ways to optimize the server as sometimes it will lag with a bunch of HTTPD processes, and high server load.

    I've just come across editing my my.cnf and here is what I have. Also I have run mysqltuner and tried to edit accordingly to it's suggestions. I just want the server to "crash" so to speak which I believe is due to the mysql.


    
    [mysqld]
    safe-show-database
    back_log = 100
    max_connections = 6000
    query_cache_type = 1 
    query_cache_size = 50M
    key_buffer = 512M
    thread_cache = 4
    skip-innodb
    log-slow-queries
    table_cache = 256
    join_buffer_size = 128M
    Code (markup):

    My Server Stats:

    Intel(R) Xeon(R) CPU X3320 @ 2.50GHz x 4 cores
    4GB MEM
    MySQL 5.0.51a
    Php 5.2.16
    Apache 2.2.17

    Thanks for your help. I am not an Expert at this stuff; but I am quite computer savy.
     
    CoolDude105, Aug 24, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    HTTPD isn't the database, it's the web (HTML) server.
     
    Rukbat, Aug 24, 2011 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    jestep, Aug 25, 2011 IP
  4. som3on3

    som3on3 Active Member

    Messages:
    138
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    63
    #4
    whatever you do, in the end mysql is slow! did you consider using a NoSQL database type? do a google search for "nosql"
     
    som3on3, Aug 25, 2011 IP
  5. CoolDude105

    CoolDude105 Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    ? It's the MYSQL that's with the 100% CPU.

    Well it looks like InnoDB is better for larger databases.. And my forum software is compatible with InnoDB. Looks like you should install spinx for search as innodb doesn't handle full text searches.. but how do I go about converting from MyISAM to InnoDB then? Keep in mind I have a 6.5GB Database.

    Will my forum software even work with nosql? :eek:
     
    CoolDude105, Aug 25, 2011 IP
  6. le_punk

    le_punk Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i have to agree with @jestep
    innodb is way better in terms of tweaking and scaling. migration is not hard at all: just dump your myisam db with the mysqldump command line tool, string replace the "type = myisam" lines in the dump, convert your db server then load the data. 7 gigs is not that much of a data, should be done in a matter of minutes
     
    le_punk, Aug 26, 2011 IP
  7. p4guru

    p4guru Active Member

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #7
    While talking about percona, i'd switch to MariaDB 5.2.x MySQL server better MyISAM and InnoDB performance overall as it's the only performance fork to continue improve MyISAM performance as well see benchmarks at http://vbtechsupport.com/606/ and http://vbtechsupport.com/657/

    Just be aware innodb uses dramatically more cpu, memory and disk storage / I/O resources than MyISAM. For 7GB database full innodb based you're need at least 8-12GB of physically installed memory and appropriate innodb tuned parameters in my.cnf
     
    p4guru, Aug 27, 2011 IP
  8. AnthonyG

    AnthonyG Well-Known Member

    Messages:
    114
    Likes Received:
    3
    Best Answers:
    2
    Trophy Points:
    135
    #8
    With a setting like this, im amazed it runs, as this is going to run the server out of ram very easily when a select or two has no indexes.
    join_buffer_size = 128M
     
    AnthonyG, Aug 27, 2011 IP
  9. CoolDude105

    CoolDude105 Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    Matter of minutes? I'm not one hundred percent sure on the procedure behind this, could you elaborate please?

    Can anyone confirm this, I would have to have that much ram installed? .. With mariaDB, I would be better off with the 4 gigs installed?

    What should I have this set at? Higher? Lower??
     
    CoolDude105, Aug 29, 2011 IP
  10. CoolDude105

    CoolDude105 Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #10
    ? anyone ?
     
    CoolDude105, Sep 11, 2011 IP