Miestre

Registered
Oct 28, 2019
2
0
1
Braga
cPanel Access Level
Root Administrator
Hello all

my cpu load on my sql is geting website slow.
I run mysqltuner.pl and return this:


>> MySQLTuner 1.7.19 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.7.26-log
[OK] Operating on 64-bit architecture

-------- Log file Recommendations ------------------------------------------------------------------
[OK] Log file /var/log/mysql/error.log exists
[--] Log file: /var/log/mysql/error.log(3M)
[OK] Log file /var/log/mysql/error.log is readable.
[OK] Log file /var/log/mysql/error.log is not empty
[OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
[!!] /var/log/mysql/error.log contains 758 warning(s).
[!!] /var/log/mysql/error.log contains 41240 error(s).
[--] 13 start(s) detected in /var/log/mysql/error.log
[--] 1) 2019-11-13T12:25:10.702413Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2019-07-17T16:32:10.217868Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2019-06-04T18:55:02.775627Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2019-05-10T04:41:48.356415Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2019-04-30T14:12:02.231931Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2019-04-30T04:42:24.293319Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2019-04-29T09:59:16.018736Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2019-04-29T09:20:04.412587Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2019-04-25T04:42:15.773527Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2019-04-25T04:42:08.868216Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5 shutdown(s) detected in /var/log/mysql/error.log
[--] 1) 2019-04-25T04:42:13.998366Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2019-04-25T04:42:07.185053Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2019-04-25T04:41:58.410817Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2019-04-10T04:41:59.615546Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2019-03-20T05:41:45.343391Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in MyISAM tables: 2.0M (Tables: 82)
[--] Data in InnoDB tables: 16.6G (Tables: 4709)
[!!] Total fragmented tables: 1

-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.

-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!

-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 147d 3h 53m 6s (8B q [655.206 qps], 17M conn, TX: 13550G, RX: 1731G)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Physical Memory : 31.3G
[--] Max MySQL memory : 145.0G
[--] Other process memory: 0B
[--] Total buffers: 18.2G global + 257.1M per thread (505 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[!!] Maximum reached memory usage: 32.3G (103.06% of installed RAM)
[!!] Maximum possible memory usage: 145.0G (463.09% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (14K/8B)
[OK] Highest usage of available connections: 11% (56/505)
[OK] Aborted connections: 0.03% (5664/17420674)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 8B selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (1M temp sorts / 1B sorts)
[!!] Joins performed without indexes: 623655991
[OK] Temporary tables created on disk: 8% (60M on disk / 716M total)
[OK] Thread cache hit rate: 99% (9K created / 17M connections)
[!!] Table cache hit rate: 0% (4K open / 224M opened)
[!!] table_definition_cache(4096) is lower than number of tables(5070)
[OK] Open file limit used: 0% (30/12K)
[OK] Table locks acquired immediately: 99% (7M immediate / 7M locks)

-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema is installed.

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.6% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/858.0K
[OK] Read Key buffer hit rate: 97.0% (4M cached / 127K reads)
[!!] Write Key buffer hit rate: 60.5% (180K cached / 108K writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 18.0G/16.6G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (5.55555555555556 %): 512.0M * 2/18.0G should be equal to 25%
[!!] InnoDB buffer pool instances: 8
[--] Number of InnoDB Buffer Pool Chunk : 144 for 8 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (1079133822955 hits/ 1079134424317 total)
[!!] InnoDB Write Log efficiency: 89.05% (494470642 hits/ 555242913 total)
[OK] InnoDB log waits: 0.00% (0 waits / 60772271 writes)

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is disabled.

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.

-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: ROW
[--] XA support enabled: ON
[--] Semi synchronous replication Master: Not Activated
[--] Semi synchronous replication Slave: Not Activated
[--] This is a standalone server

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Control warning line(s) into /var/log/mysql/error.log file
Control error line(s) into /var/log/mysql/error.log file
Run OPTIMIZE TABLE to defragment tables for better performance
OPTIMIZE TABLE `excitasy_presta1614`.`ps_product_lang`; -- can free 384 MB
Total freed space after theses OPTIMIZE TABLE : 384 Mb
Reduce your overall MySQL memory footprint for system stability
Dedicate this server to your database for highest performance.
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
(specially the conclusions at the bottom of the page).
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: https://bit.ly/2Fulv7r
Read this before increasing for MariaDB https://mariadb.com/kb/en/library/optimizing-table_open_cache/
This is MyISAM only table_cache scalability problem, InnoDB not affected.
See more details here: https://bugs.mysql.com/bug.php?id=49177
This bug already fixed in MySQL 5.7.9 and newer MySQL versions.
Beware that open_files_limit (12000) variable
should be greater than table_open_cache (4096)
Performance schema should be activated for better diagnostics
Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_size (=0)
query_cache_type (=0)
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with JOINs)
table_open_cache (> 4096)
table_definition_cache(4096) > 5070 or -1 (autosizing if supported)
performance_schema = ON enable PFS
innodb_log_file_size should be (=2G) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
innodb_buffer_pool_instances(=18)

 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
MySQL tuner provides you with suggestions to improve performance. If you are not comfortable performing these actions, I would recommend you work with your system administrator to ensure the integrity of your system. If you do not have a system administrator, you may be able to find assistance at System Administration Services.