Skip to main content

mysql queries taking up over 100% CPU size

Comments

5 comments

  • 24x7ss
    Re: mysql quaries taking up over 100% CPU size I will recommend you to use mysql tunner script to optimize your mysql settings. Also, if you want to increase the performance of website then you can go MariaDB.
    0
  • cPanelMichael
    Re: mysql quaries taking up over 100% CPU size Hello :) You may receive more user-feedback if you post the output of a MySQL tuner. The following thread should help you get started: mysqlmymonlite.sh server stats gathering tool for cPanel Server Thank you.
    0
  • Ayodeji Ibrahim
    Re: mysql quaries taking up over 100% CPU size here is mysqltuner output
    /$ ./mysqltuner.pl >> MySQLTuner 1.4.0 - Major Hayden >> Bug reports, feature requests, and downloads at [url=http://mysqltuner.com/]MySQLTuner-perl by major >> Run with '--help' for additional options and output filtering Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. [[0;32mOK[0m] Currently running supported MySQL version 5.5.40-cll Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. [[0;32mOK[0m] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [[0;34m--[0m] Status: [0;32m+ARCHIVE [0m[0;32m+BLACKHOLE [0m[0;32m+CSV [0m[0;31m-FEDERATED [0m[0;32m+InnoDB [0m[0;32m+MRG_MYISAM [0m Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. [[0;34m--[0m] Data in MyISAM tables: 264M (Tables: 88) [[0;34m--[0m] Data in InnoDB tables: 112M (Tables: 483) [[0;34m--[0m] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [[0;31m!![0m] Total fragmented tables: 340 Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. -------- Security Recommendations ------------------------------------------- [[0;32mOK[0m] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [[0;34m--[0m] Up for: 7m 14s (34K q [78.601 qps], 781 conn, TX: 70M, RX: 4M) [[0;34m--[0m] Reads / Writes: 84% / 16% [[0;34m--[0m] Total buffers: 1.3G global + 2.2M per thread (1000 max threads) [[0;32mOK[0m] Maximum possible memory usage: 3.5G (7% of installed RAM) [[0;32mOK[0m] Slow queries: 0% (0/34K) [[0;32mOK[0m] Highest usage of available connections: 0% (8/1000) [[0;32mOK[0m] Key buffer size / total MyISAM indexes: 8.0M/4.5M [[0;32mOK[0m] Key buffer hit rate: 99.9% (152K cached / 174 reads) [[0;32mOK[0m] Query cache efficiency: 41.3% (10K cached / 25K selects) [[0;32mOK[0m] Query cache prunes per day: 0 [[0;32mOK[0m] Sorts requiring temporary tables: 0% (0 temp sorts / 123 sorts) [[0;31m!![0m] Temporary tables created on disk: 40% (25 on disk / 61 total) [[0;32mOK[0m] Thread cache hit rate: 98% (8 created / 781 connections) [[0;32mOK[0m] Table cache hit rate: 95% (140 open / 147 opened) [[0;32mOK[0m] Open file limit used: 0% (48/20K) [[0;32mOK[0m] Table locks acquired immediately: 99% (17K immediate / 17K locks) [[0;32mOK[0m] InnoDB buffer pool / data size: 128.0M/112.6M [[0;32mOK[0m] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Temporary table size is already large - reduce result set size Reduce your SELECT DISTINCT queries without LIMIT clauses /$ ./mysqltuner.pl >> MySQLTuner 1.4.0 - Major Hayden >> Bug reports, feature requests, and downloads at [url=http://mysqltuner.com/]MySQLTuner-perl by major >> Run with '--help' for additional options and output filtering Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. [[0;32mOK[0m] Currently running supported MySQL version 5.5.40-cll [[0;32mOK[0m] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. [[0;34m--[0m] Status: [0;32m+ARCHIVE [0m[0;32m+BLACKHOLE [0m[0;32m+CSV [0m[0;31m-FEDERATED [0m[0;32m+InnoDB [0m[0;32m+MRG_MYISAM [0m [[0;34m--[0m] Data in MyISAM tables: 264M (Tables: 88) [[0;34m--[0m] Data in InnoDB tables: 112M (Tables: 483) [[0;34m--[0m] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [[0;31m!![0m] Total fragmented tables: 340 Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead. -------- Security Recommendations ------------------------------------------- [[0;32mOK[0m] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [[0;34m--[0m] Up for: 7m 47s (36K q [77.773 qps], 889 conn, TX: 73M, RX: 4M) [[0;34m--[0m] Reads / Writes: 83% / 17% [[0;34m--[0m] Total buffers: 1.3G global + 2.2M per thread (1000 max threads) [[0;32mOK[0m] Maximum possible memory usage: 3.5G (7% of installed RAM) [[0;32mOK[0m] Slow queries: 0% (0/36K) [[0;32mOK[0m] Highest usage of available connections: 0% (8/1000) [[0;32mOK[0m] Key buffer size / total MyISAM indexes: 8.0M/4.5M [[0;32mOK[0m] Key buffer hit rate: 99.9% (152K cached / 215 reads) [[0;32mOK[0m] Query cache efficiency: 43.5% (11K cached / 26K selects) [[0;32mOK[0m] Query cache prunes per day: 0 [[0;32mOK[0m] Sorts requiring temporary tables: 0% (0 temp sorts / 135 sorts) [[0;31m!![0m] Temporary tables created on disk: 31% (31 on disk / 97 total) [[0;32mOK[0m] Thread cache hit rate: 99% (8 created / 889 connections) [[0;32mOK[0m] Table cache hit rate: 98% (634 open / 641 opened) [[0;32mOK[0m] Open file limit used: 1% (228/20K) [[0;32mOK[0m] Table locks acquired immediately: 99% (18K immediate / 18K locks) [[0;32mOK[0m] InnoDB buffer pool / data size: 128.0M/112.6M [[0;32mOK[0m] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Temporary table size is already large - reduce result set size Reduce your SELECT DISTINCT queries without LIMIT clauses
    0
  • cPanelMichael
    Re: mysql quaries taking up over 100% CPU size Also, keep in mind that you should let MySQL run for at least 24 hours before running the tuner to get accurate results. Thank you.
    0
  • Ayodeji Ibrahim
    Re: mysql quaries taking up over 100% CPU size
    ]Also, keep in mind that you should let MySQL run for at least 24 hours before running the tuner to get accurate results. Thank you.

    here is mysqltuner reccommendation now
    -------- Performance Metrics ------------------------------------------------- [[0;34m--[0m] Up for: 6h 35m 17s (20M q [852.189 qps], 16K conn, TX: 89B, RX: 3B) [[0;34m--[0m] Reads / Writes: 98% / 2% [[0;34m--[0m] Total buffers: 1.6G global + 12.6M per thread (1000 max threads) [[0;32mOK[0m] Maximum possible memory usage: 13.9G (29% of installed RAM) [[0;32mOK[0m] Slow queries: 0% (152/20M) [[0;32mOK[0m] Highest usage of available connections: 4% (44/1000) [[0;32mOK[0m] Key buffer size / total MyISAM indexes: 1000.0M/4.5M [[0;32mOK[0m] Key buffer hit rate: 100.0% (39M cached / 566 reads) [[0;32mOK[0m] Query cache efficiency: 80.1% (16M cached / 20M selects) [[0;32mOK[0m] Query cache prunes per day: 0 [[0;32mOK[0m] Sorts requiring temporary tables: 0% (147 temp sorts / 3M sorts) [[0;31m!![0m] Joins performed without indexes: 128 [[0;31m!![0m] Temporary tables created on disk: 67% (4K on disk / 6K total) [[0;32mOK[0m] Thread cache hit rate: 91% (1K created / 16K connections) [[0;32mOK[0m] Table cache hit rate: 99% (1K open / 1K opened) [[0;32mOK[0m] Open file limit used: 2% (324/11K) [[0;32mOK[0m] Table locks acquired immediately: 99% (4M immediate / 4M locks) [[0;32mOK[0m] InnoDB buffer pool / data size: 128.0M/120.9M [[0;32mOK[0m] InnoDB log waits: 0 -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Adjust your join queries to always utilize indexes Temporary table size is already large - reduce result set size Reduce your SELECT DISTINCT queries without LIMIT clauses Variables to adjust: join_buffer_size (> 4.0M, or always use indexes with joins)
    0

Please sign in to leave a comment.