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!