wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello eva2000
I know your script from many years ago in another forum :)
Right now, I want to run it on a new server to which I migrated a month ago.
80% of the tables are innodb, the rest, myisam.
The server is a VPS SSD, with 8GB of ram and 2 processors.
The use of cpu is increased by mysql, it is the one that mainly consumes my resources.
Do you suggest any kind of special configuration / execution to optimize mysql with your script?
In advance, thanks and best regards!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @wonder_wonder,

I moved your post to it's own thread. Can you share the MySQL tuning script results so we can see if there's anything obvious to suggest in terms of MySQL configuration changes?

Thank you.
 
  • Like
Reactions: wonder_wonder

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello.
I install mysqlmymonlite.sh and this is the report.
The mysql server has only started for less than 2 hours, I had to restart it.
It might be better to wait, for example, for the entire weekend and carry out the execution again.

Code:
[root@server ~]# ./mysqlmymonlite.sh
ERROR 3167 (HY000) at line 1: The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'
please see help for all options available
./mysqlmymonlite.sh --help

install mysqlmymonlite.sh at /root
chmod +x mysqlmymonlite.sh

./mysqlmymonlite.sh --help
./mysqlmymonlite.sh check
./mysqlmymonlite.sh run
./mysqlmymonlite.sh mysql
./mysqlmymonlite.sh vmstat
./mysqlmymonlite.sh showcreate
./mysqlmymonlite.sh showindex
./mysqlmymonlite.sh vbshowtables
./mysqlmymonlite.sh dblist
./mysqlmymonlite.sh mysqlreport
./mysqlmymonlite.sh mysqlfullreport
./mysqlmymonlite.sh mysqltuner
./mysqlmymonlite.sh psmem
./mysqlmymonlite.sh pschema
And then:

Code:
[root@server ~]# ./mysqlmymonlite.sh mysqltuner
ERROR 3167 (HY000) at line 1: The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'

-------------------------------------------------------------
System MySQL monitoring stats
mysqlmymonlite.sh - 0.5.7 WHM mysqlmymon.com
compiled by George Liu (eva2000) centminmod.com
-------------------------------------------------------------

Report Generated:
Fri Feb 15 10:09:10 CET 2019

-------------------------------------------------
mysqltuner output
-------------------------------------------------
mysqltuner.pl [found]
 >>  MySQLTuner 1.7.14 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Modified by George Liu (eva2000) at https://centminmod.com/
 >>  Run with '--help' for additional options and output filtering

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

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mysqld.log(587K)
[OK] Log file /var/log/mysqld.log exists
[OK] Log file /var/log/mysqld.log is readable.
[OK] Log file /var/log/mysqld.log is not empty
[OK] Log file /var/log/mysqld.log is smaller than 32 Mb
[!!] /var/log/mysqld.log contains 114 warning(s).
[!!] /var/log/mysqld.log contains 1170 error(s).
[--] 55 start(s) detected in /var/log/mysqld.log
[--] 1) 2019-02-15T07:12:08.659593Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2019-02-15T00:25:19.453876Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2019-02-14T10:54:37.207506Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2019-02-14T00:04:35.215673Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2019-02-13T18:51:33.560844Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2019-02-13T10:06:51.816140Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2019-02-13T08:31:58.107077Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2019-02-12T21:03:25.524902Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2019-02-10T12:52:53.315655Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2019-02-10T12:23:25.561930Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 51 shutdown(s) detected in /var/log/mysqld.log
[--] 1) 2019-02-15T07:12:07.632665Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2019-02-14T09:07:04.956446Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2019-02-14T00:02:23.699031Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2019-02-13T18:51:32.115308Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2019-02-13T10:06:51.113015Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 6) 2019-02-13T08:31:57.122786Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 7) 2019-02-12T21:03:24.401047Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 8) 2019-02-10T12:46:44.504257Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 9) 2019-02-10T11:44:59.747255Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 10) 2019-02-10T07:40:04.617071Z 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: 13.3M (Tables: 14)
[--] Data in InnoDB tables: 5.7G (Tables: 230)
[--] Data in MEMORY tables: 2.1M (Tables: 2)
[OK] Total fragmented tables: 0

-------- 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: 1h 57m 2s (1M q [146.275 qps], 59K conn, TX: 55G, RX: 531M)
[--] Reads / Writes: 87% / 13%
[--] Binary logging is disabled
[--] Physical Memory     : 7.6G
[--] Max MySQL memory    : 338.9M
[--] Other process memory: 0B
[--] Total buffers: 169.0M global + 1.1M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 184.8M (2.36% of installed RAM)
[OK] Maximum possible memory usage: 338.9M (4.33% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/1M)
[OK] Highest usage of available connections: 9% (14/151)
[OK] Aborted connections: 0.12%  (72/59916)
[!!] 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 / 738K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 3% (4K temp sorts / 148K sorts)
[!!] Joins performed without indexes: 800
[OK] Temporary tables created on disk: 16% (26K on disk / 162K total)
[OK] Thread cache hit rate: 99% (16 created / 59K connections)
[OK] Table cache hit rate: 21% (1K open / 9K opened)
[OK] Open file limit used: 1% (125/10K)
[OK] Table locks acquired immediately: 99% (222K immediate / 222K 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: 36.7% (3M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/3.4M
[OK] Read Key buffer hit rate: 99.7% (466K cached / 1K reads)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 128.0M/5.7G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (75 %): 48.0M * 2/128.0M should be equal 25%
[OK] InnoDB buffer pool instances: 1
[--] Number of InnoDB Buffer Pool Chunk : 1 for 1 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: 98.51% (875493397 hits/ 888760080 total)
[!!] InnoDB Write Log efficiency: 41.57% (33531 hits/ 80669 total)
[OK] InnoDB log waits: 0.00% (0 waits / 47138 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/mysqld.log file
    Control error line(s) into /var/log/mysqld.log file
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes. Please note this
    calculation is made by adding Select_full_join + Select_range_check
    status values and triggered when the total >250
    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:
    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)
    performance_schema = ON enable PFS
    innodb_buffer_pool_size (>= 5.7G) if possible.
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.

Report Complete:
Fri Feb 15 10:09:11 CET 2019
----------------------------
[root@server ~]#
Thank you very much!!
Regards.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
[--] Up for: 1h 57m 2s (1M q [146.275 qps], 59K conn, TX: 55G, RX: 531M)
The mysql server has only started for less than 2 hours, I had to restart it.
It might be better to wait, for example, for the entire weekend and carry out the execution again.
Hello @wonder_wonder,

I recommend letting MySQL run for at least 24 hours before running the tuner to ensure you have accurate results.

Thank you.
 

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello @cPanelMichael !!

I had to let a few more days pass because I had to restart the server for various reasons.
Right now it takes little more than 3 days uninterruptedly.
Here are the results of mysqlmymonlite.sh mysqltuner

I must indicate that I have high server loads, the average is 1.8 - 2.0 - 2.5

I look for the cause but I can not find it, I have limited access to boots and reduced the google boot (it is constant on the site).
I do not know if only having 2 cpus is little, but I have in this server 8 gb of ram and I know that mysql is not optimized for the resources that I have.

Code:
[root@server ~]# ./mysqlmymonlite.sh mysqltuner
ERROR 3167 (HY000) at line 1: The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'

-------------------------------------------------------------
System MySQL monitoring stats
mysqlmymonlite.sh - 0.5.7 WHM mysqlmymon.com
compiled by George Liu (eva2000) centminmod.com
-------------------------------------------------------------

Report Generated:
Mon Feb 25 20:22:02 CET 2019

-------------------------------------------------
mysqltuner output
-------------------------------------------------
mysqltuner.pl [found]
 >>  MySQLTuner 1.7.14 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Modified by George Liu (eva2000) at https://centminmod.com/
 >>  Run with '--help' for additional options and output filtering

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

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mysqld.log(661K)
[OK] Log file /var/log/mysqld.log exists
[OK] Log file /var/log/mysqld.log is readable.
[OK] Log file /var/log/mysqld.log is not empty
[OK] Log file /var/log/mysqld.log is smaller than 32 Mb
[!!] /var/log/mysqld.log contains 128 warning(s).
[!!] /var/log/mysqld.log contains 1303 error(s).
[--] 62 start(s) detected in /var/log/mysqld.log
[--] 1) 2019-02-22T11:24:18.062219Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2019-02-22T11:03:27.273659Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2019-02-22T10:55:25.213984Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2019-02-22T10:08:28.391453Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2019-02-21T19:13:57.626509Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2019-02-19T19:08:34.291327Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2019-02-15T09:34:20.599680Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2019-02-15T07:12:08.659593Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2019-02-15T00:25:19.453876Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2019-02-14T10:54:37.207506Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 58 shutdown(s) detected in /var/log/mysqld.log
[--] 1) 2019-02-22T11:22:14.999823Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2019-02-22T11:01:15.048075Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2019-02-22T10:53:13.120352Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2019-02-22T10:08:27.603548Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2019-02-21T19:11:50.184124Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 6) 2019-02-19T19:08:33.324450Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 7) 2019-02-15T09:32:09.691665Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 8) 2019-02-15T07:12:07.632665Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 9) 2019-02-14T09:07:04.956446Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 10) 2019-02-14T00:02:23.699031Z 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: 13.3M (Tables: 14)
[--] Data in InnoDB tables: 10.3G (Tables: 230)
[--] Data in MEMORY tables: 3.9M (Tables: 2)
[OK] Total fragmented tables: 0

-------- 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: 3d 7h 57m 50s (39M q [135.713 qps], 2M conn, TX: 1810G, RX: 23G)
[--] Reads / Writes: 87% / 13%
[--] Binary logging is disabled
[--] Physical Memory     : 7.6G
[--] Max MySQL memory    : 338.9M
[--] Other process memory: 0B
[--] Total buffers: 169.0M global + 1.1M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 229.8M (2.94% of installed RAM)
[OK] Maximum possible memory usage: 338.9M (4.33% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/39M)
[OK] Highest usage of available connections: 35% (54/151)
[OK] Aborted connections: 0.00%  (41/2003956)
[!!] 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 / 28M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 5% (325K temp sorts / 5M sorts)
[!!] Joins performed without indexes: 36813
[!!] Temporary tables created on disk: 36% (1M on disk / 4M total)
[OK] Thread cache hit rate: 99% (899 created / 2M connections)
[!!] Table cache hit rate: 4% (1K open / 41K opened)
[OK] Open file limit used: 0% (96/10K)
[OK] Table locks acquired immediately: 99% (8M immediate / 8M 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: 39.6% (3M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/3.4M
[OK] Read Key buffer hit rate: 100.0% (23M cached / 1K reads)
[OK] Write Key buffer hit rate: 100.0% (38 cached / 38 writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 128.0M/10.3G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (75 %): 48.0M * 2/128.0M should be equal 25%
[OK] InnoDB buffer pool instances: 1
[--] Number of InnoDB Buffer Pool Chunk : 1 for 1 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: 98.96% (44583819118 hits/ 45051568158 total)
[!!] InnoDB Write Log efficiency: 51.77% (2057611 hits/ 3974531 total)
[OK] InnoDB log waits: 0.00% (0 waits / 1916920 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/mysqld.log file
    Control error line(s) into /var/log/mysqld.log file
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes. Please note this
    calculation is made by adding Select_full_join + Select_range_check
    status values and triggered when the total >250
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    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 (10000) variable
    should be greater than table_open_cache (2000)
    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:
    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)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    table_open_cache (> 2000)
    performance_schema = ON enable PFS
    innodb_buffer_pool_size (>= 10.3G) if possible.
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.

Report Complete:
Mon Feb 25 20:22:03 CET 2019
----------------------------
[root@server ~]#
Beforehand thank you very much!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @wonder_wonder,

You could try adjusting the individual variables noted under the Variables to adjust section at the end of the MySQL tuner results. Then, let MySQL run for 24 hours and run the tuner again to see if the results change.

You may also find the following links helpful (the second is useful if you host multiple WordPress websites):

What kind of stack are people using for speed?
WordPress Optimization/Server Optimization « WordPress Codex

Additionally, if you need direct assistance with tuning MySQL, you may want to consult with a qualified system administrator. We provide a list of companies offering system administration services on the link below:

System Administration Services | cPanel Forums

Thank you.
 
  • Like
Reactions: wonder_wonder

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello @cPanelMichael !

You could try adjusting the individual variables noted under the Variables to adjust section at the end of the MySQL tuner results. Then, let MySQL run for 24 hours and run the tuner again to see if the results change.
Ok, perfect!
I have one doubt, for example, some values indicate like this:
table_open_cache (> 2000)
I understand that, I need adjust table_open_cache a some value higer than 2000, but what value? 2500, 3000...? Or set some value and try again 24 after set this news values?

No, my site isn't Wordpress :)

Additionally, if you need direct assistance with tuning MySQL, you may want to consult with a qualified system administrator. We provide a list of companies offering system administration services on the link below:
Thanks, yes, I was think in this, at the moment, I want try if I can solved o tuning by myself (with yours help of course), also, I don't have much money... :(

I wat to made this changes until one ticket that I was open yesterday are resolved, I preferer not change any in my server because cpanel are investigate one issue that I have.
When this ticket is closed then I made the changes and I go post results here.

Thank you very very much @cPanelMichael !!
 
Last edited:
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @wonder_wonder,

I understand that, I need adjust table_open_cache a some value higer than 2000, but what value? 2500, 3000...? Or set some value and try again 24 after set this news values?
Yes, one approach is to increment the value higher (e.g. 2100), let MySQL run for 24 hours, and then run the tuner again to see if the results are improved.

When this ticket is closed then I made the changes and I go post results here.
Sounds good. Let us know how it goes.

Thank you.
 
  • Like
Reactions: wonder_wonder

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Finally I made the changes even if the open ticket has not yet been resolved, it's another completely different issue and does not affect mysql at all :)

In the first moment, when restarting mysql, I had an error about this line:

Code:
innodb_buffer_pool_size (>= 10.3G) if possible.
I was changed this line to 10 or 11 (not with decimals) and all fine.

Everything worked very well for a few hours, at night, when more visitors I have, I was sleeping, the next morning I had a notice of whm via mail indicating:
That there had been a high use of cpu and could not restart the mysql server (a few minutes later), the high CPU usage, were very high values, and my server does not have those cpu usage values, in fact, from the changes made, the use of cpu has stabilized at very good values.

So lower that value to 6G, and a few hours later I had this warning email:
Code:
Out of memory: The process “mysqld” was terminated because the system is low on memory.
 

In order to avoid a system crash due to low memory, the kernel terminated the process named “mysqld” with the PID “19410”.
Server     server.xxx.com
Primary IP Address     xxxx
Process Name     mysqld
Event Time     Thursday, February 28, 2019 at 2:32:50 AM UTC
PID     19410
Process Total Virtual Memory     13977124kB
Process Anonymous Resident Set Size     6120620kB
Process File Resident Set Size     0kB
Process OOM Score     765
Status     Out of Memory ⚠
Memory Information  
Used     4.78 GB
Available     2.86 GB
Installed     7.64 GB
Load Information     0.56 0.41 0.34
I deduced again that it was due to that value, and now I have lowered it to 4G.
At the moment it takes a few hours without notice, but I must wait at least 24 hours to see if I do not have another notice.

My server have 8gb of ram, I think that value of 10.3 exceeds my ram, but then I established it in 6g (which does not exceed the total of 8 I have) I had notice of it after some hours of use.
Maybe I need to increase ram on my server?

Thanks and regards!!!
 
Last edited:
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
I deduced again that it was due to that value, and now I have lowered it to 4G. At the moment it takes a few hours without notice, but I must wait at least 24 hours to see if I do not have another notice.
Let us know how it turns out. I recommend continuing to fine tune the MySQL configuration file based on the results before upgrading your server to use more RAM.

Thank you.
 

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello @cPanelMichael !!
Let us know how it turns out. I recommend continuing to fine tune the MySQL configuration file based on the results before upgrading your server to use more RAM.
Yes. I have spent a few / many days because, the first few days, by tests / changes / tests ... I could not get the mysql server more than 24/48 hours uninterrupted.
During these days, and with my current configuration, I have observed that, after 2, 3 or 4 days of mysql use (sometimes more, but it is not an exact number of days), I have had a drop in the service of both camld and mysql
I think it's because memory is exhausted, in fact, in a mail received by my cpanel on the fall of clamd, if I remember correctly, came to say it, little ram free.
Through cPanel I observe that the use of memory is 85-87%
Just started the mysql server the use of ram is less, but in a few hours it reaches 83-84%, then very little by little, it goes up and the most I have come to see is 87-88%, after that, it is when I suffer a restart of clamd and / or mysql.
Yes, now I think about 3 days and I have not had that reboot, and the last one was for an update of WHM with Kernel (I do not have kernel care) and I had to reboot.
At this precise moment the use of ram is located at 87%

Right at this moment I'm running ./mysqlmymonlite.sh mysqltuner and this are the results:
Code:
[root@server ~]# ./mysqlmymonlite.sh mysqltuner
ERROR 3167 (HY000) at line 1: The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'

-------------------------------------------------------------
System MySQL monitoring stats
mysqlmymonlite.sh - 0.5.7 WHM mysqlmymon.com
compiled by George Liu (eva2000) centminmod.com
-------------------------------------------------------------

Report Generated:
Mon Mar 25 19:22:24 CET 2019

-------------------------------------------------
mysqltuner output
-------------------------------------------------
mysqltuner.pl [found]
 >>  MySQLTuner 1.7.14 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Modified by George Liu (eva2000) at https://centminmod.com/
 >>  Run with '--help' for additional options and output filtering

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

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mysqld.log(826K)
[OK] Log file /var/log/mysqld.log exists
[OK] Log file /var/log/mysqld.log is readable.
[OK] Log file /var/log/mysqld.log is not empty
[OK] Log file /var/log/mysqld.log is smaller than 32 Mb
[!!] /var/log/mysqld.log contains 194 warning(s).
[!!] /var/log/mysqld.log contains 1692 error(s).
[--] 81 start(s) detected in /var/log/mysqld.log
[--] 1) 2019-03-20T13:11:30.273274Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2019-03-20T10:04:26.740104Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2019-03-17T10:10:53.718173Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2019-03-15T00:18:42.614763Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2019-03-15T00:18:39.875653Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2019-03-12T02:14:29.805380Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2019-03-12T02:14:26.961436Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2019-03-05T00:16:06.820783Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2019-02-28T17:14:19.622116Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2019-02-28T08:34:54.461208Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 82 shutdown(s) detected in /var/log/mysqld.log
[--] 1) 2019-03-20T13:09:17.147127Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2019-03-20T10:04:24.567481Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2019-03-15T00:18:41.484745Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2019-03-12T02:14:28.595985Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2019-02-28T17:14:17.660283Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 6) 2019-02-28T08:34:52.042115Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 7) 2019-02-28T02:33:18.782576Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 8) 2019-02-27T12:35:29.260480Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 9) 2019-02-27T10:32:25.421497Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 10) 2019-02-27T10:32:13.916609Z 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: 17.5M (Tables: 17)
[--] Data in InnoDB tables: 10.3G (Tables: 230)
[--] Data in MEMORY tables: 3.7M (Tables: 2)
[!!] 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: 5d 5h 11m 1s (24M q [53.905 qps], 980K conn, TX: 946G, RX: 11G)
[--] Reads / Writes: 80% / 20%
[--] Binary logging is disabled
[--] Physical Memory     : 7.6G
[--] Max MySQL memory    : 4.3G
[--] Other process memory: 0B
[--] Total buffers: 4.1G global + 1.9M per thread (151 max threads)
[--] P_S Max memory usage: 72B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 4.1G (53.76% of installed RAM)
[OK] Maximum possible memory usage: 4.3G (56.70% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/24M)
[OK] Highest usage of available connections: 18% (28/151)
[OK] Aborted connections: 0.01%  (62/980977)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 1% (46K temp sorts / 3M sorts)
[!!] Joins performed without indexes: 73535
[OK] Temporary tables created on disk: 9% (545K on disk / 5M total)
[OK] Thread cache hit rate: 99% (735 created / 980K connections)
[!!] Table cache hit rate: 3% (2K open / 56K opened)
[OK] Open file limit used: 1% (190/10K)
[OK] Table locks acquired immediately: 99% (4M immediate / 4M locks)

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

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

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 43.7% (3M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/4.6M
[OK] Read Key buffer hit rate: 100.0% (28M cached / 2K reads)
[OK] Write Key buffer hit rate: 98.2% (23K cached / 23K writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 4.0G/10.3G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (0.78125 %): 16.0M * 2/4.0G should be equal 25%
[!!] InnoDB buffer pool instances: 8
[--] Number of InnoDB Buffer Pool Chunk : 32 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% (62452962495 hits/ 62455141122 total)
[!!] InnoDB Write Log efficiency: 64.5% (4013063 hits/ 6221913 total)
[OK] InnoDB log waits: 0.00% (0 waits / 2208850 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/mysqld.log file
    Control error line(s) into /var/log/mysqld.log file
    Run OPTIMIZE TABLE to defragment tables for better performance
      OPTIMIZE TABLE `forocabl_vbcablevb`.`postparsed`; -- can free 1524 MB
    Total freed space after theses OPTIMIZE TABLE : 1524 Mb
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes. Please note this
    calculation is made by adding Select_full_join + Select_range_check
    status values and triggered when the total >250
    Increase table_open_cache gradually to avoid file descriptor limits
    Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    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 (10000) variable
    should be greater than table_open_cache (2100)
    Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
Variables to adjust:
    join_buffer_size (> 1.0M, or always use indexes with JOINs)
    table_open_cache (> 2100)
    innodb_buffer_pool_size (>= 10.3G) if possible.
    innodb_log_file_size should be (=512M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
    innodb_buffer_pool_instances(=4)

Report Complete:
Mon Mar 25 19:22:25 CET 2019
----------------------------
[root@server ~]#
I just saw that it is not 3 or 4 days what has been running, they are more than 5 days :)

At this point, I think you can readjust more parameters that it offers to readjust, except that of innodb_buffer_pool_size (maybe this is even the one that should go down a bit so as not to have mysql crashes / restarts due to lack of memory), but I do not know if I must expand ram on server.
Currently I have 8GB, I do not think I have so much traffic to expand, although it is true that the database is something big ...

As always, thank you very much and a strong greeting!
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @wonder_wonder,

The following resource offers some insight into memory usage on Linux that you may find helpful:

Tutorial - Understanding Memory Usage On Linux Operating Systems

As far as adding more RAM to the server, the information you've provided suggests the addition of more RAM isn't necessary due to the limited usage of your websites. At this point, you may want to consult with a qualified system administrator to see if there's any additional optimization steps you should take:

System Administration Services | cPanel Forums

Thank you.
 
  • Like
Reactions: wonder_wonder

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hi @cPanelMichael !

Hello @wonder_wonder,

The following resource offers some insight into memory usage on Linux that you may find helpful:

Tutorial - Understanding Memory Usage On Linux Operating Systems
Ok, thanks for the link, I go to read :)

As far as adding more RAM to the server, the information you've provided suggests the addition of more RAM isn't necessary due to the limited usage of your websites.
Yes,
I do not have high traffic, there may be between 3,000 - 6,000 visits per day, which means that in a minute, there are not many users connected at the same time.
I think that no more ram is necessary, but these aspects are the ones that I control the least, so I ask for help / advice in this thread.
At the moment I guess I'll have to adjust the parameters until I find the optimal configuration, without the mysql server falling, but without increasing ram.
This data, the possibility of needing more ram, is just the one who did not know, did not know if it was necessary to increase ram on the server or not.

At this point, you may want to consult with a qualified system administrator to see if there's any additional optimization steps you should take:

System Administration Services | cPanel Forums

Thank you.
Thanks at you! For now, I will see if I can adjust it with the data provided, I do not have much budget, if necessary, if I will resort to it. In your opinion, how do you see the resources / configuration of mysql on my server?
I comment this because, the developers of the code of the site that there is in this server, they indicated to me that, arrived at the point that this the web, requires almost 70-80% of the resources of the server for mysql, the rest of options (php. ..etc ...) do not require.

For now, I'm adjusting values offered by this script one by one.

Again, thank you very much!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
I think it's because memory is exhausted, in fact, in a mail received by my cpanel on the fall of clamd, if I remember correctly, came to say it, little ram free.
Is clamd the only service you noticed failing? If so, check this post to see if it's the same problem.

Thank you.
 

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Is clamd the only service you noticed failing? If so, check this post to see if it's the same problem.

Thank you.
Hello!
No, isn't the only servide I noticied failing and I read the post and isn't the same problem.
I'm noticied for clamd and mysql.
But for a fiew days ago, I don't received any notification about this.
Its because the server is left with little memory (I do not remember the message textually, but in one of them, notification mail, it said, for little available memory, clamd service is stopped).

I have been making the adjustments that this plugin indicates, as the days go by, I execute it and I readjust.
But about it, I get a couple of questions and / or problems.
For example:

mysqlmymonlite.sh mysqltuner suggest to me this:

Code:
Variables to adjust:
   join_buffer_size (> 1.0M, or always use indexes with JOINs)
In this case, I can set to > 2.0M but I dont know how "or always use indexes with JOINs".
Code:
   innodb_buffer_pool_size (>= 10.3G) if possible.
I can't set any value containing decimals, in this example, 10.3G, only can set 10G, 9G or 11G, if I set 10.x (or any other non-whole value) when restart mysql server, I have a error about this value and not start mysql.
Also, my server have 8GB or RAM, I can't set 10.3G because only have 8GB, and if I set some value higer than 3 or 4G is when, after 2, 3 or 4 days the server gets to run out of memory and is when I receive the notifications of clamd stopped and mysql restarter.

Thank you very much!!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello @wonder_wonder,

While the MySQL tuning script can offer general advice, more advanced tuning may require the assistance of a qualified system administrator. I'll leave this thread open so other users may offer input, but note you may need to get in touch with a system administrator using the link in my earlier post.

Thank you.
 

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello @cPanelMichael !

Yes, I understand that a more advanced optimization requires the assistance of a qualified system administrator.
For now, I'll see if I solve the doubts indicated in my last answer, especially not being able to establish decimals in innodb_buffer_pool_size (10.x, 3.x, 4.x) G, for example.
It is a site that I believe that with the recommendations of MySQL tuning script it can work very well. After the reconfigurations that I have been doing throughout these days / weeks, I have noticed that the site works very well.
Those 2 settings are what would be defined more accurately, and know if it requires more ram the server or not.
To see if any user can indicate any more data, for now I will continue to test and if necessary, recurire, as you comment, to assistance of a qualified system administrator.
As always, thanks and best regards.
 
  • Like
Reactions: cPanelMichael

wonder_wonder

Well-Known Member
Jan 16, 2019
108
40
28
Spain
cPanel Access Level
Root Administrator
Hello (again :))
I'm making readjustments and every time it works better and every time I need to do less readjustments :)

However, for me it would be ideal (or I think) maybe have a little more ram, not much more, maybe 2-4 gb of ram, just for, a value that this script advises me to increase, if I put the value that I indicates, I can leave the server almost with out of ram.
I have thought, read and searched a lot about the possibility of adding those 2-4 gb of ram in swap.
This server is 100% SSD, maybe it has a bit of degradation (some sites say that yes others do not, there are opinions of all kinds) but as a general rule, it is usually advisable to put or add swap.
Currently I do not have swap on this server, but I can add it.
You advise me?
Thanks, as always :)