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.

My way to optimize MySQL in cPanel VPS

Discussion in 'Workarounds and Optimization' started by tampdm.soft, Oct 31, 2013.

  1. tampdm.soft

    tampdm.soft Registered

    Joined:
    Oct 31, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    When set to default cPanel VPS , you need to step through the installation , configuration profiles . However, if your website hits are much larger or website , you need to prepare all steps connected via file / etc / my.cnf of MySQL .

    The mission of the file / etc / my.cnf that helps you optimize the visitor to connect to the MySQL database VPS . Optimization will include visits to the higher speed , cache more data would help reduce the number of duplicate connections . Also, at some point , set consistent MySQL will help you make the most of the VPS RAM instead of increasing high cpu load when the rush hits on .

    To edit the file / etc / my.cnf , you need to access using Putty software and connect to the VPS via SSH . After logging in as root , you can type the following command to access and edit the file / etc / my.cnf


    vi / etc / my.cnf


    The default contents of this file is not much . We can refer to the following parameters for the initial setup :

    [mysqld]
    skip-external-locking
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=3000
    max_user_connections=600
    interactive_timeout=100
    wait_timeout=100
    connect_timeout=10
    thread_stack=128K
    thread_cache_size=128
    myisam-recover=BACKUP
    #key_buffer - 64M for 1GB, 128M for 2GB, 256 for 4GB
    key_buffer=64M
    #join_buffer_size - 1M for 1GB, 2M for 2GB, 4M for 4GB
    join_buffer=1M
    max_allowed_packet=32M
    table_cache=1024
    #sort_buffer_size - 1M for 1GB, 2M for 2GB, 4M for 4GB
    sort_buffer_size=1M
    #read_buffer_size - 1M for 1GB, 2M for 2GB, 4M for 4GB
    read_buffer_size=1M
    #read_rnd_buffer_size - 768K for 1GB, 1536K for 2GB, 3072K for 4GB
    read_rnd_buffer_size=768K
    max_connect_errors=10
    thread_concurrency=4
    #myisam_sort_buffer_size - 32M for 1GB, 64M for 2GB, 128 for 4GB
    myisam_sort_buffer_size=32M
    skip-locking
    skip-bdb


    You try to optimize some parameters through which they made ​​it anyway . Do not forget to combine mysqltuner.pl use more light, will give much better results there .
    Thanks all reading!Hope additional complete if it's failure? : P
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. tampdm.soft

    tampdm.soft Registered

    Joined:
    Oct 31, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    There are things I know but some people do not know. There are also things people know but I do not know! This forum there are things I need to learn more!
    Thanks ad Michael.
     
Loading...

Share This Page