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.

please Help for mysql optimization...

Discussion in 'Workarounds and Optimization' started by delehost, Dec 14, 2012.

  1. delehost

    delehost Registered

    Joined:
    Dec 14, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I am here to have your great help about mysql optimization. I have server with this:


    24 GB RAM
    Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
    750GB X 2 hard disk

    PHP:
    Processor Information
    Total processors
    8
    Processor 
    #1
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    1600.000 MHz
    Cache
    8192 KB
    Processor 
    #2
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #3
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #4
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #5
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #6
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #7
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB
    Processor 
    #8
    Vendor
    GenuineIntel
    Name
    Intel
    (RCore(TMi7 CPU 920 2.67GHz
    Speed
    2667.000 MHz
    Cache
    8192 KB


    PHP:
    Linux server.delehost.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

    this my.cnf
    PHP:
    [mysqld]
    local-infile=0
    datadir
    =/var/lib/mysql
    skip
    -locking
    skip
    -innodb
    skip
    -networking
    safe
    -show-database
    query_cache_limit
    =1M
    query_cache_size
    =256M 
    query_cache_type
    =1
    max_user_connections
    =200
    max_connections
    =800
    interactive_timeout
    =20
    wait_timeout
    =60
    connect_timeout
    =20
    thread_cache_size
    =512
    key_buffer
    =1024M
    join_buffer
    =1M
    max_connect_errors
    =20
    max_allowed_packet
    =16M
    table_cache
    =1024
    table_lock_wait_timeout 
    15
    record_buffer
    =1M
    sort_buffer_size
    =8M 
    read_buffer_size
    =8M 
    read_rnd_buffer_size
    =8M 
    thread_concurrency
    =
    myisam_sort_buffer_size
    =64M


    # Log slow queries
    log_slow_queries=/var/log/mysqld.slow.log
    long_query_time
    =50

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

    [mysqldump]
    quick
    max_allowed_packet
    =1024M

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

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

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

    [mysqlhotcopy]
    interactive-timeout
    local
    -infile=0


    I request you to please let me know that how may i optimize mysql?

    and this MySQL Performance Tuning Primer Script
    PHP:
            -- MYSQL PERFORMANCE TUNING PRIMER --
                 - 
    ByMatthew Montgomery -

    MySQL Version 5.1.65-cll x86_64

    Uptime 
    0 days 0 hrs 0 min 26 sec
    Avg
    qps 10
    Total Questions 
    260
    Threads Connected 
    1

    Warning
    Server has not been running for at least 48hrs.
    It may not be safe to use these recommendations

    To find out more information on how each of these
    runtime variables effects performance visit
    :
    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
    Visit http://www.mysql.com/products/enterprise/advisors.html
    for info about MySQL's Enterprise Monitoring and Advisory Service

    SLOW QUERIES
    The slow query log is enabled.
    Current long_query_time = 50.000000 sec.
    You have 0 out of 281 that take longer than 50.000000 sec. to complete
    Your long_query_time seems to be fine

    BINARY UPDATE LOG
    The binary update log is NOT enabled.
    You will not be able to do point in time recovery
    See http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html

    WORKER THREADS
    Current thread_cache_size = 512
    Current threads_cached = 5
    Current threads_per_sec = 0
    Historic threads_per_sec = 0
    Your thread_cache_size is fine

    MAX CONNECTIONS
    Current max_connections = 800
    Current threads_connected = 1
    Historic max_used_connections = 6
    The number of used connections is 0% of the configured maximum.
    You are using less than 10% of your configured max_connections.
    Lowering max_connections could help to avoid an over-allocation of memory
    See "MEMORY USAGE" section to make sure you are not over-allocating

    No InnoDB Support Enabled!

    MEMORY USAGE
    Max Memory Ever Allocated : 1.39 G
    Configured Max Per-thread Buffers : 19.72 G
    Configured Max Global Buffers : 1.25 G
    Configured Max Memory Limit : 20.97 G
    Physical Memory : 23.58 G
    Max memory limit seem to be within acceptable norms

    KEY BUFFER
    Current MyISAM index space = 441 M
    Current key_buffer_size = 1.00 G
    Key cache miss rate is 1 : 92
    Key buffer free ratio = 81 %
    Your key_buffer_size seems to be fine

    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 256 M
    Current query_cache_used = 334 K
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = .12 %
    Current query_cache_min_res_unit = 4 K
    Your query_cache_size seems to be too high.
    Perhaps you can use these resources elsewhere
    MySQL won'
    t cache query results that are larger than query_cache_limit in size

    SORT OPERATIONS
    Current sort_buffer_size 
    8 M
    Current read_rnd_buffer_size 
    8 M
    Sort buffer seems to be fine

    JOINS
    Current join_buffer_size 
    1.00 M
    You have had 19 queries where a join could not 
    use an index properly
    You have had 19 joins without keys that check 
    for key usage after each row
    You should enable 
    "log-queries-not-using-indexes"
    Then look for non indexed joins in the slow query log.
    If 
    you are unable to optimize your queries you may want to increase your
    join_buffer_size to accommodate larger joins in one pass
    .

    NoteThis script will still suggest raising the join_buffer_size when
    ANY joins not using indexes are found
    .

    OPEN FILES LIMIT
    Current open_files_limit 
    8192 files
    The open_files_limit should typically be set to at least 2x
    -3x
    that of table_cache 
    if you have heavy MyISAM usage.
    Your open_files_limit value seems to be fine

    TABLE CACHE
    Current table_open_cache 
    1024 tables
    Current table_definition_cache 
    256 tables
    You have a total of 903 tables
    You have 924 open tables
    .
    The table_cache value seems to be fine
    You should probably increase your table_definition_cache value
    .

    TEMP TABLES
    Current max_heap_table_size 
    16 M
    Current tmp_table_size 
    16 M
    Of 210 temp tables
    14were created on disk
    Created disk tmp tables ratio seems fine

    TABLE SCANS
    Current read_buffer_size 
    8 M
    Current table scan ratio 
    396 1
    read_buffer_size seems to be fine

    TABLE LOCKING
    Current Lock Wait ratio 
    260
    You may benefit from selective 
    use of InnoDB.
    If 
    you have long running SELECT's against MyISAM tables and perform
    frequent updates consider setting '
    low_priority_updates=1'
    If you have a high concurrency of inserts on Dynamic row-length tables
    consider setting '
    concurrent_insert=2'.
    Note: I am not a expert, please try to explain step by step and clearly.

    Regards,
    motasem
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Your server has only been up a few minutes,
    Run the Tuning Primer Script after your server has been running for at least 48 hours.
     
Loading...

Share This Page