The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Conf suggestions on 512MB ram

Discussion in 'General Discussion' started by taimz, Mar 8, 2005.

  1. taimz

    taimz Registered

    Joined:
    Dec 7, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have some difficulties about mysql. I currently host about 100 sites and I only have 512mb of ram. Server load is normal, about ~0.5 - 1, BUT in some time the SQL server crashes with overload. I may happend about 3 times per day or sometimes it happend once in a week. My current conf is:

    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    key_buffer = 90M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    myisam_sort_buffer_size = 8M
    query_cache_size = 32M
    max_connections = 200

    log-bin

    server-id = 1

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash

    [isamchk]
    key_buffer = 64M
    sort_buffer_size = 64M
    read_buffer = 2M
    read_rnd_buffer_size = 768k
    write_buffer = 2M

    [myisamchk]
    key_buffer = 64M
    sort_buffer_size = 64M
    read_buffer = 2M
    read_rnd_buffer_size = 768k
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout


    Any suggestions on that?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Just one thing I noticed - Is you query cache working? You might want to put the following after the query-cache-size directive:

    query-cache-type = 1
     
  3. taimz

    taimz Registered

    Joined:
    Dec 7, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    thank you for that
     
  4. eglwolf

    eglwolf Well-Known Member

    Joined:
    Jan 1, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    This is what I use on smaller 756 MG RAm VPS servers:

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=500
    interactive_timeout=100
    wait_timeout=100
    connect_timeout=10
    thread_cache_size=128
    key_buffer=16M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=1024
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    max_connect_errors=10
    thread_concurrency=2
    myisam_sort_buffer_size=64M
    #log-bin
    server-id=1
    flush_time = 30


    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    pid-file=/var/lib/mysql/mysql.pid
    open_files_limit=8192

    [mysqldump]
    quick
    max_allowed_packet=16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [myisamchk]
    key_buffer=64M
     
Loading...

Share This Page