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.

Help with my.cnf

Discussion in 'Workarounds and Optimization' started by Motasem, Jul 13, 2015.

  1. Motasem

    Motasem Member

    Joined:
    Jul 13, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Jordan
    cPanel Access Level:
    Root Administrator
    Hi..

    please can any body help me with configration my.cnf file

    and my VPS have load always although my websites does not have visits more than 1000K every day

    and in this moment there is no traffic on my websites.. but i see this:
    Server Load 0.42 (2 CPUs)
    Memory Used 9.36% (561,092 of 5,992,152)
    Swap Used 0% (0 of 0)

    - Removed -
     
    #1 Motasem, Jul 13, 2015
    Last edited by a moderator: Jul 13, 2015
  2. Motasem

    Motasem Member

    Joined:
    Jul 13, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Jordan
    cPanel Access Level:
    Root Administrator
    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-external-locking
    join_buffer_size = 2M
    max_heap_table_size = 256M
    tmp_table_size = 256M
    key_buffer_size = 128M
    max_allowed_packet = 1M
    table_open_cache = 512
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency = 8

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates

    [myisamchk]
    key_buffer_size = 128M
    sort_buffer_size = 128M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,774
    Likes Received:
    663
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  4. Motasem

    Motasem Member

    Joined:
    Jul 13, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Jordan
    cPanel Access Level:
    Root Administrator
    hi,

    this is my result

    General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Enable the slow query log to troubleshoot bad queries
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Variables to adjust:
    *** MySQL's maximum memory usage is dangerously high ***
    *** Add RAM before increasing MySQL buffer variables ***
    key_buffer_size (~ 56M)
    tmp_table_size (> 32M)
    max_heap_table_size (> 10M)
    table_open_cache (> 1000)


    please can you tell me what could i do?
     
  5. Motasem

    Motasem Member

    Joined:
    Jul 13, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Jordan
    cPanel Access Level:
    Root Administrator
    my vps ram: 6 GB

    cpu: 2 core

    my hard disk boost SSD
     
  6. Motasem

    Motasem Member

    Joined:
    Jul 13, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Jordan
    cPanel Access Level:
    Root Administrator
    my current sittings


    [mysqld]
    datadir=/var/lib/mysql
    port = 3306
    socket=/var/lib/mysql/mysql.sock
    query_cache_limit=128M
    query_cache_size=192M ## ## 32MB for every 1GB of RAM
    query_cache_type=1
    tmp_table_size=32M
    max_heap_table_size= 10M
    max_user_connections=300
    max_connections=300
    max_allowed_packet=128M
    interactive_timeout=600
    wait_timeout=600
    connect_timeout=10
    thread_cache_size=40
    table_open_cache=1000
    key_buffer=256M ## 128MB for every 1GB of RAM
    join_buffer_size=2M
    sort_buffer_size=6M ## 1MB for every 1GB of RAM
    read_buffer_size=6M ## 1MB for every 1GB of RAM
    read_rnd_buffer_size=6M ## 1MB for every 1GB of RAM
    thread_concurrency=4 ## Number of CPUs x 2
    myisam_sort_buffer_size=64M

    [mysql.server]
    user=mysql

    [safe_mysqld]
    log-error= /var/log/mysql_error_log
    pid-file=/var/lib/mysql/mysql.pid
    open_files_limit=5000

    [mysqldump]
    quick
    max_allowed_packet=128M

    [mysql]
    no-auto-rehash

    [myisamchk]
    key_buffer=20M
    sort_buffer=20M
    read_buffer=20M
    write_buffer=20M

    [mysqlhotcopy]
    interactive-timeout
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,774
    Likes Received:
    663
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Please ensure you let MySQL run for at least 24 hours before running the tuner to ensure accurate results.

    Thank you.
     
Loading...

Share This Page