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.

Seeking Help in Optimizing my.cnf

Discussion in 'Workarounds and Optimization' started by laztrix, Jan 17, 2014.

  1. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Hello,

    I feel like I'm not getting everything out of my server, which is pretty good in my opinion. These are the specs:

    Harddisk: 2x 2000 GB SATA 3,5" 7.200 rpm
    CPU: AMD Opteron 3280 Octacore
    Barebone: Fujitsu PRIMERGY MX130 S2
    RAM: 24x Gigabyte RAM

    I was advised that I should also looking into optimizing my mysql settings. I had a go at it, made some adjustments. This is my current my.cnf file:

    Code:
    [mysqld]
    local-infile=0
    safe-show-database
    default-character-set=utf8
    default-collation=utf8_general_ci
    max_connections = 600
    max_user_connections=100
    key_buffer_size = 512M
    myisam_sort_buffer_size = 64M
    read_buffer_size = 1M
    table_open_cache = 5000
    thread_cache_size = 384
    wait_timeout = 20
    connect_timeout = 10
    tmp_table_size = 256M
    max_heap_table_size = 128M
    max_allowed_packet = 64M
    net_buffer_length = 16384
    max_connect_errors = 10
    concurrent_insert = 2
    #table_lock_wait_timeout only for mysql5
    table_lock_wait_timeout = 10
    read_rnd_buffer_size = 786432
    bulk_insert_buffer_size = 8M
    query_cache_limit = 5M
    query_cache_size = 128M
    query_cache_type = 1
    query_prealloc_size = 262144
    query_alloc_block_size = 65536
    transaction_alloc_block_size = 8192
    transaction_prealloc_size = 4096
    max_write_lock_count = 8
    slow_query_log
    external-locking=FALSE
    open_files_limit=50000
    
    [mysqldump]
    quick
    max_allowed_packet = 16M
    
    [isamchk]
    key_buffer = 384M
    sort_buffer = 384M
    read_buffer = 256M
    write_buffer = 256M
    
    [myisamchk]
    key_buffer = 384M
    sort_buffer = 384M
    read_buffer = 256M
    write_buffer = 256M
    
    #### Per connection configuration ####
    sort_buffer_size = 1M
    join_buffer_size = 1M
    thread_stack = 192K
    
    These are the pictures I've got out of mysqltuner and Tuning Primer:

    [​IMG]
    [​IMG]
    [​IMG]

    [​IMG]

    I appreciate if you could share what exactly I should change & add to my settings.

    Thank you in advance.
     

    Attached Files:

    #1 laztrix, Jan 17, 2014
    Last edited: Jan 17, 2014
  2. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    It seems like you didnt restart mysql after changing my.cnf
    so restart mysql now, and later generate mysqltuner.pl again

    and to your current config add
    innodb_buffer_pool_size = 300M
     
    #2 thinkbot, Jan 18, 2014
    Last edited: Jan 18, 2014
  3. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thanks for the answer,

    I remember that I did, what makes you say I didn't, just curious...
     
  4. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    The results of mysqltuner informes about completely different variables than your my.cnf
     
  5. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I had read an article about a sample my.cnf for 24 GB servers. MySQL won't start now. Your're right...
     
  6. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    remove this from your my.cnf
    safe-show-database

    its probably the reason why its not starting
     
  7. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Didn't start after that either.
     
  8. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    copy last 500 lines of error log here
     
  9. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Cold we rather built a new my.cnf file?

    I temporarily used this one to get my sites working again:

    Code:
    # Example MySQL config file for very large systems.
    #
    # This is for a large system with memory of 1G-2G where the system runs mainly
    # MySQL.
    #
    # MySQL programs look for option files in a set of
    # locations which depend on the deployment platform.
    # You can copy this option file to one of those
    # locations. For information about these locations, see:
    # MySQL :: MySQL 5.6 Reference Manual :: 4.2.3.3 Using Option Files
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.
    
    # The following options will be passed to all MySQL clients
    [client]
    #password	= your_password
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    
    # Here follows entries for some specific programs
    
    # The MySQL server
    [mysqld]
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    skip-external-locking
    key_buffer_size = 384M
    max_allowed_packet = 32M
    table_open_cache = 5096
    sort_buffer_size = 2M
    read_buffer_size = 2M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size = 64M
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency = 8
    log-slow-queries
    local-infile=0
    innodb_file_per_table=1
    
    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!
    #
    #skip-networking
    
    # Replication Master Server (default)
    # binary logging is required for replication
    #log-bin=mysql-bin
    
    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id	= 1
    max_connections = 400
    open_files_limit=11354
    [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 = 256M
    sort_buffer_size = 256M
    read_buffer = 2M
    write_buffer = 2M
    
    [mysqlhotcopy]
    interactive-timeout
    
     
  10. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    here:

    Code:
    [client]
    #password	= your_password
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    
    [mysqld]
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    
    skip-external-locking
    key_buffer_size = 500M
    max_allowed_packet = 32M
    table_open_cache = 1000
    sort_buffer_size = 256K
    read_buffer_size = 128K
    read_rnd_buffer_size = 256K
    
    myisam_sort_buffer_size = 64M
    thread_cache_size = 16
    
    query_cache_type = 1
    query_cache_size = 30M
    query_cache_limit = 1M
    
    innodb_buffer_pool_size = 1200M
    
    max_heap_table_size = 50M
    tmp_table_size = 50M
    
    local-infile=0
    innodb_file_per_table=1
    
    max_connections = 300
    open_files_limit=25000
    
    [mysqldump]
    quick
    max_allowed_packet = 16M
    
    [mysql]
    no-auto-rehash
    
    [myisamchk]
    key_buffer_size = 256M
    sort_buffer_size = 256M
    read_buffer = 2M
    write_buffer = 2M
    
    [mysqlhotcopy]
    interactive-timeout
    
     
  11. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thank you that worked. I'll post the new suggestions from mysqltuner and tuning-primer after 24 hours
     
  12. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Tuning Primer

    Code:
    
            -- MYSQL PERFORMANCE TUNING PRIMER --
                 - By: Matthew Montgomery -
    
    MySQL Version 5.5.34-cll x86_64
    
    Uptime = 1 days 2 hrs 40 min 38 sec
    Avg. qps = 89
    Total Questions = 8624533
    Threads Connected = 3
    
    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.5/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 NOT enabled.
    Current long_query_time = 10.000000 sec.
    You have 28 out of 8624554 that take longer than 10.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.5/en/point-in-time-recovery.html
    
    WORKER THREADS
    Current thread_cache_size = 16
    Current threads_cached = 14
    Current threads_per_sec = 0
    Historic threads_per_sec = 0
    Your thread_cache_size is fine
    
    MAX CONNECTIONS
    Current max_connections = 300
    Current threads_connected = 3
    Historic max_used_connections = 52
    The number of used connections is 17% of the configured maximum.
    Your max_connections variable seems to be fine.
    
    INNODB STATUS
    Current InnoDB index space = 425 M
    Current InnoDB data space = 913 M
    Current InnoDB buffer pool free = 0 %
    Current innodb_buffer_pool_size = 1.17 G
    Depending on how much space your innodb indexes take up it may be safe
    to increase this value to up to 2 / 3 of total system memory
    
    MEMORY USAGE
    Max Memory Ever Allocated : 1.75 G
    Configured Max Per-thread Buffers : 300 M
    Configured Max Global Buffers : 1.70 G
    Configured Max Memory Limit : 1.99 G
    Physical Memory : 23.40 G
    Max memory limit seem to be within acceptable norms
    
    KEY BUFFER
    Current MyISAM index space = 417 M
    Current key_buffer_size = 500 M
    Key cache miss rate is 1 : 330
    Key buffer free ratio = 79 %
    Your key_buffer_size seems to be fine
    
    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 30 M
    Current query_cache_used = 25 M
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = 85.38 %
    Current query_cache_min_res_unit = 4 K
    However, 581866 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    MySQL won't cache query results that are larger than query_cache_limit in size
    
    SORT OPERATIONS
    Current sort_buffer_size = 256 K
    Current read_rnd_buffer_size = 256 K
    Sort buffer seems to be fine
    
    JOINS
    Current join_buffer_size = 132.00 K
    You have had 4336 queries where a join could not use an index properly
    You have had 110 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.
    
    Note! This script will still suggest raising the join_buffer_size when
    ANY joins not using indexes are found.
    
    OPEN FILES LIMIT
    Current open_files_limit = 25000 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 = 1000 tables
    Current table_definition_cache = 400 tables
    You have a total of 1287 tables
    You have 1000 open tables.
    Current table_cache hit rate is 0%
    , while 100% of your table cache is in use
    You should probably increase your table_cache
    You should probably increase your table_definition_cache value.
    
    TEMP TABLES
    Current max_heap_table_size = 50 M
    Current tmp_table_size = 50 M
    Of 133202 temp tables, 27% were created on disk
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size
    to reduce the number of disk-based temporary tables
    Note! BLOB and TEXT columns are not allow in memory tables.
    If you are using these columns raising these values might not impact your
    ratio of on disk temp tables.
    
    TABLE SCANS
    Current read_buffer_size = 128 K
    Current table scan ratio = 1689 : 1
    read_buffer_size seems to be fine
    
    TABLE LOCKING
    Current Lock Wait ratio = 1 : 1812
    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=ALWAYS'.
    
    MySQL Tuner

    Code:
    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.5.34-cll
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 816M (Tables: 646)
    [--] Data in InnoDB tables: 913M (Tables: 582)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
    [--] Data in MEMORY tables: 1M (Tables: 18)
    [!!] Total fragmented tables: 149
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 1d 2h 43m 25s (8M q [89.728 qps], 392K conn, TX: 44B, RX: 2B)
    [--] Reads / Writes: 56% / 44%
    [--] Total buffers: 1.8G global + 1.0M per thread (300 max threads)
    [OK] Maximum possible memory usage: 2.0G (8% of installed RAM)
    [OK] Slow queries: 0% (28/8M)
    [OK] Highest usage of available connections: 17% (52/300)
    [OK] Key buffer size / total MyISAM indexes: 500.0M/417.8M
    [OK] Key buffer hit rate: 99.7% (93M cached / 283K reads)
    [OK] Query cache efficiency: 78.3% (4M cached / 6M selects)
    [!!] Query cache prunes per day: 522946
    [OK] Sorts requiring temporary tables: 2% (5K temp sorts / 215K sorts)
    [!!] Joins performed without indexes: 4450
    [!!] Temporary tables created on disk: 27% (50K on disk / 184K total)
    [OK] Thread cache hit rate: 99% (88 created / 392K connections)
    [!!] Table cache hit rate: 0% (1K open / 826K opened)
    [OK] Open file limit used: 4% (1K/25K)
    [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)
    [OK] InnoDB data size / buffer pool: 913.4M/1.2G
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Enable the slow query log to troubleshoot bad queries
        Adjust your join queries to always utilize indexes
        When making adjustments, make tmp_table_size/max_heap_table_size equal
        Reduce your SELECT DISTINCT queries without LIMIT clauses
        Increase table_cache gradually to avoid file descriptor limits
    Variables to adjust:
        query_cache_size (> 30M)
        join_buffer_size (> 128.0K, or always use indexes with joins)
        tmp_table_size (> 50M)
        max_heap_table_size (> 50M)
        table_cache (> 1000)
    
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To note, the MySQL error log is located at /var/lib/mysql/$hostname.err by default. You can review the last few lines of this log file if you encounter an issue with MySQL not starting again in the future. It typically outputs a message that makes it relatively easy to determine which value in your /etc/my.cnf (assuming that's the reason) is preventing MySQL from starting.

    Thank you.
     
  14. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Tahnk you for your note. Do you have any suggestions base on my newly posted reviews?
     
  15. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    OK much better, but

    since
    [!!] Joins performed without indexes: 4450
    [!!] Temporary tables created on disk: 27% (50K on disk / 184K total)
    [!!] Table cache hit rate: 0% (1K open / 826K opened)

    you need to optimize the queries, especially the ones using temporary tables on disk,
    turn on slow queries tracking longer than 0.1
    add there

    slow_query_log=1
    slow_query_log_file=mysql-slow.log
    long_query_time=0.1

    and you can increase query cache a bit:
    query_cache_size = 75M
    and this
    table_open_cache = 4000

    before restarting, generate slow log review of current slow queries (by default longer than 10 s)
    like this:
    mkdir /root/install
    cd /root/install
    wget http://percona.com/get/pt-query-digest
    chmod +x pt-query-digest
    ./pt-query-digest /var/lib/mysql/mysql-slow.log > slow.txt
    and copy slow.txt here in code brackets

    then remove old slow log, rm /var/lib/mysql/mysql-slow.log

    and restart mysql

    edit: those values should be added in [mysqld] section
     
  16. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Code:
    
    # 360ms user time, 50ms system time, 32.24M rss, 225.12M vsz
    # Current date: Mon Jan 20 21:01:38 2014
    # Hostname: name of the hostname
    # Files: /var/lib/mysql/mysql-slow.log
    # Overall: 22 total, 4 unique, 0.40 QPS, 0.01x concurrency _______________
    # Time range: 2014-01-18 21:13:22 to 21:14:17
    # Attribute          total     min     max     avg     95%  stddev  median
    # ============     ======= ======= ======= ======= ======= ======= =======
    # Exec time          591ms   147us   275ms    27ms    17ms    69ms     3ms
    # Lock time            2ms    27us   244us    79us   159us    51us    60us
    # Rows sent          4.97k       0     962  231.55  202.40  231.41  192.76
    # Rows examine      11.42k       0   3.83k  531.36  234.30   1.01k  234.30
    # Query size         2.87k      68     844  133.55  158.58  177.21   69.19
    
    # Profile
    # Rank Query ID           Response time Calls R/Call V/M   Item
    # ==== ================== ============= ===== ====== ===== ===============
    #    1 0xBD4BC31A0EE1EE7A  0.5020 84.9%     2 0.2510  0.00 INSERT xf_session
    #    2 0x92F3B1B361FB0E5B  0.0535  9.0%    16 0.0033  0.00 SELECT wp_options
    #    3 0xF8EC4434E0061E89  0.0356  6.0%     2 0.0178  0.00 SELECT wp_terms wp_term_taxonomy
    # MISC 0xMISC              0.0003  0.1%     2 0.0002   0.0 <1 ITEMS>
    
    # Query 1: 0 QPS, 0x concurrency, ID 0xBD4BC31A0EE1EE7A at byte 3122 _____
    # This item is included in the report because it matches --limit.
    # Scores: V/M = 0.00
    # Time range: all events occurred at 2014-01-18 21:13:48
    # Attribute    pct   total     min     max     avg     95%  stddev  median
    # ============ === ======= ======= ======= ======= ======= ======= =======
    # Count          9       2
    # Exec time     84   502ms   227ms   275ms   251ms   275ms    33ms   251ms
    # Lock time      3    55us    27us    28us    27us    28us       0    27us
    # Rows sent      0       0       0       0       0       0       0       0
    # Rows examine   0       0       0       0       0       0       0       0
    # Query size    45   1.30k     490     844     667     844  250.32     667
    # String:
    # Databases    divnet_vt (1/50%), kadinla1_x... (1/50%)
    # Hosts        localhost
    # Users        divnet_use... (1/50%), kadinla1_x... (1/50%)
    # Query_time distribution
    #   1us
    #  10us
    # 100us
    #   1ms
    #  10ms
    # 100ms  ################################################################
    #    1s
    #  10s+
    # Tables
    #    SHOW TABLE STATUS FROM `kadinla1_xfdb` LIKE 'xf_session'\G
    #    SHOW CREATE TABLE `kadinla1_xfdb`.`xf_session`\G
    INSERT INTO `xf_session` (`session_id`, `session_data`, `expiry_date`) VALUES ('98c4068052d068967077577451ad89a7', 'a:9:{s:12:\"sessionStart\";i:1390076027;s:2:\"ip\";i:1594422636;s:9:\"userAgent\";s:143:\"Mozilla/5.0 (Linux; U; Android 2.3.6; tr-tr; GT-S5830i Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\";s:7:\"robotId\";s:0:\"\";s:7:\"referer\";s:307:\"http://www.google.com/search?client=ms-android-samsung&hl=tr&v=133247963&biw=320&bih=233&tbm=isch&sa=1&ei=F9_aUrCTE46BhAfgu4DgCg&q=t%C4%B1rnak+modelleri&oq=tirnak&gs_l=mobile-gws-serp.1.3.0l5.141011.162274.0.167335.36.18.0.1.1.1.489.3830.0j1j1j2j6.10.0....0...1c.1.32.mobile-gws-serp..26.10.3743.k21AEL-DkYc\";s:10:\"fromSearch\";s:6:\"google\";s:16:\"previousActivity\";i:0;s:10:\"isIpBanned\";b:0;s:13:\"isDiscouraged\";b:0;}', '1390079627')\G
    
    # Query 2: 0.29 QPS, 0.00x concurrency, ID 0x92F3B1B361FB0E5B at byte 2555
    # This item is included in the report because it matches --limit.
    # Scores: V/M = 0.00
    # Time range: 2014-01-18 21:13:22 to 21:14:17
    # Attribute    pct   total     min     max     avg     95%  stddev  median
    # ============ === ======= ======= ======= ======= ======= ======= =======
    # Count         72      16
    # Exec time      9    53ms     1ms     5ms     3ms     4ms   940us     3ms
    # Lock time     82     1ms    50us   244us    90us   167us    55us    60us
    # Rows sent     62   3.09k     197     204  197.88  202.40    3.19  192.76
    # Rows examine  32   3.75k     239     246  239.88  234.30       0  234.30
    # Query size    38   1.11k      71      71      71      71       0      71
    # String:
    # Databases    kadinla1_p... (14/87%), annekuzu_g... (2/12%)
    # Hosts        localhost
    # Users        kadinla1_p... (14/87%), annekuzu_g... (2/12%)
    # Query_time distribution
    #   1us
    #  10us
    # 100us
    #   1ms  ################################################################
    #  10ms
    # 100ms
    #    1s
    #  10s+
    # Tables
    #    SHOW TABLE STATUS FROM `kadinla1_portal` LIKE 'wp_options'\G
    #    SHOW CREATE TABLE `kadinla1_portal`.`wp_options`\G
    # EXPLAIN /*!50100 PARTITIONS*/
    SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'\G
    
    # Query 3: 0.08 QPS, 0.00x concurrency, ID 0xF8EC4434E0061E89 at byte 446
    # This item is included in the report because it matches --limit.
    # Scores: V/M = 0.00
    # Time range: 2014-01-18 21:13:23 to 21:13:47
    # Attribute    pct   total     min     max     avg     95%  stddev  median
    # ============ === ======= ======= ======= ======= ======= ======= =======
    # Count          9       2
    # Exec time      6    36ms    18ms    18ms    18ms    18ms    86us    18ms
    # Lock time      7   128us    61us    67us    64us    67us     4us    64us
    # Rows sent     37   1.88k     962     962     962     962       0     962
    # Rows examine  67   7.66k   3.83k   3.83k   3.83k   3.83k       0   3.83k
    # Query size    11     332     166     166     166     166       0     166
    # String:
    # Databases    kadinla1_portal
    # Hosts        localhost
    # Users        kadinla1_portal
    # Query_time distribution
    #   1us
    #  10us
    # 100us
    #   1ms
    #  10ms  ################################################################
    # 100ms
    #    1s
    #  10s+
    # Tables
    #    SHOW TABLE STATUS FROM `kadinla1_portal` LIKE 'wp_terms'\G
    #    SHOW CREATE TABLE `kadinla1_portal`.`wp_terms`\G
    #    SHOW TABLE STATUS FROM `kadinla1_portal` LIKE 'wp_term_taxonomy'\G
    #    SHOW CREATE TABLE `kadinla1_portal`.`wp_term_taxonomy`\G
    # EXPLAIN /*!50100 PARTITIONS*/
    SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('post_tag') AND tt.count > 0 ORDER BY t.name ASC\G
    
     
  17. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    you generated review of new slow queries, not the old one
    # Time range: 2014-01-18 21:13:22 to 21:14:17

    old one is lost now, we need to wait several hours than regenerate review of slow queries again
     
  18. laztrix

    laztrix Active Member

    Joined:
    Feb 7, 2012
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I swiched to Percona yesterday, one other thing that was suggested to me. Here are the new results:

    Code:
            -- MYSQL PERFORMANCE TUNING PRIMER --
                 - By: Matthew Montgomery -
    
    MySQL Version 5.5.35-33.0 x86_64
    
    Uptime = 1 days 2 hrs 29 min 27 sec
    Avg. qps = 77
    Total Questions = 7422704
    Threads Connected = 3
    
    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.5/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 NOT enabled.
    Current long_query_time = 10.000000 sec.
    You have 2 out of 7422743 that take longer than 10.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.5/en/point-in-time-recovery.html
    
    WORKER THREADS
    Current thread_cache_size = 16
    Current threads_cached = 13
    Current threads_per_sec = 0
    Historic threads_per_sec = 0
    Your thread_cache_size is fine
    
    MAX CONNECTIONS
    Current max_connections = 300
    Current threads_connected = 3
    Historic max_used_connections = 16
    The number of used connections is 5% 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
    
    INNODB STATUS
    Current InnoDB index space = 428 M
    Current InnoDB data space = 896 M
    Current InnoDB buffer pool free = 1 %
    Current innodb_buffer_pool_size = 1.17 G
    Depending on how much space your innodb indexes take up it may be safe
    to increase this value to up to 2 / 3 of total system memory
    
    MEMORY USAGE
    Max Memory Ever Allocated : 1.76 G
    Configured Max Per-thread Buffers : 300 M
    Configured Max Global Buffers : 1.74 G
    Configured Max Memory Limit : 2.04 G
    Physical Memory : 23.40 G
    Max memory limit seem to be within acceptable norms
    
    KEY BUFFER
    Current MyISAM index space = 433 M
    Current key_buffer_size = 500 M
    Key cache miss rate is 1 : 1845
    Key buffer free ratio = 72 %
    Your key_buffer_size seems to be fine
    
    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 75 M
    Current query_cache_used = 61 M
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = 82.09 %
    Current query_cache_min_res_unit = 4 K
    However, 159332 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    MySQL won't cache query results that are larger than query_cache_limit in size
    
    SORT OPERATIONS
    Current sort_buffer_size = 256 K
    Current read_rnd_buffer_size = 256 K
    Sort buffer seems to be fine
    
    JOINS
    Current join_buffer_size = 132.00 K
    You have had 3787 queries where a join could not use an index properly
    You have had 80 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.
    
    Note! This script will still suggest raising the join_buffer_size when
    ANY joins not using indexes are found.
    
    OPEN FILES LIMIT
    Current open_files_limit = 25000 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 = 4000 tables
    Current table_definition_cache = 400 tables
    You have a total of 1289 tables
    You have 2509 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 = 50 M
    Current tmp_table_size = 50 M
    Of 138265 temp tables, 28% were created on disk
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size
    to reduce the number of disk-based temporary tables
    Note! BLOB and TEXT columns are not allow in memory tables.
    If you are using these columns raising these values might not impact your
    ratio of on disk temp tables.
    
    TABLE SCANS
    Current read_buffer_size = 128 K
    Current table scan ratio = 838 : 1
    read_buffer_size seems to be fine
    
    TABLE LOCKING
    Current Lock Wait ratio = 1 : 2840
    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=ALWAYS'.
    
    root@linger [~]#
    
    Code:
     >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
     >>  Run with '--help' for additional options and output filtering
    
    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.5.35-33.0
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 886M (Tables: 646)
    [--] Data in InnoDB tables: 896M (Tables: 584)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
    [--] Data in MEMORY tables: 1M (Tables: 18)
    [!!] Total fragmented tables: 152
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 1d 2h 31m 53s (7M q [77.798 qps], 340K conn, TX: 39B, RX: 1B)
    [--] Reads / Writes: 61% / 39%
    [--] Total buffers: 1.8G global + 1.0M per thread (300 max threads)
    [OK] Maximum possible memory usage: 2.1G (8% of installed RAM)
    [OK] Slow queries: 0% (2/7M)
    [OK] Highest usage of available connections: 5% (16/300)
    [OK] Key buffer size / total MyISAM indexes: 500.0M/433.3M
    [OK] Key buffer hit rate: 99.9% (73M cached / 39K reads)
    [OK] Query cache efficiency: 82.9% (4M cached / 5M selects)
    [!!] Query cache prunes per day: 144129
    [OK] Sorts requiring temporary tables: 1% (2K temp sorts / 223K sorts)
    [!!] Joins performed without indexes: 3869
    [!!] Temporary tables created on disk: 28% (53K on disk / 192K total)
    [OK] Thread cache hit rate: 99% (16 created / 340K connections)
    [!!] Table cache hit rate: 0% (2K open / 417K opened)
    [OK] Open file limit used: 7% (1K/25K)
    [OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
    [OK] InnoDB data size / buffer pool: 896.7M/1.2G
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Enable the slow query log to troubleshoot bad queries
        Adjust your join queries to always utilize indexes
        When making adjustments, make tmp_table_size/max_heap_table_size equal
        Reduce your SELECT DISTINCT queries without LIMIT clauses
        Increase table_cache gradually to avoid file descriptor limits
    Variables to adjust:
        query_cache_size (> 75M)
        join_buffer_size (> 128.0K, or always use indexes with joins)
        tmp_table_size (> 50M)
        max_heap_table_size (> 50M)
        table_cache (> 4000)
    
    root@linger [~]#
    
    I had to remove your last suggestions because it wouldn't let me run "mysql_upgrade" command.
     
Loading...

Share This Page