nicedood

Registered
Jul 8, 2020
2
0
1
CA
cPanel Access Level
Root Administrator
Hi all,

I just started using WHM so bear with my noobness :).

I have a VPS from Godaddy 4vCPU 8 GB RAM 200GB SSD. It is currently running 4 Wordpress sites, but I am still migrating about 16 over from a similar specced shared server I used to have with godaddy (decided it was time for an upgrade from shared hosting).

Anyway, currently I'm about 7% RAM usage with the 4 sites, and I'm guessing this will go higher with the more sites I migrate over (they are all WordPress). I have already optimized the server using the tweak settings, but I wanted to see what the best settings for my server running MySQL 5.7 are. Here is the sql tuner report below:



Code:
[[email protected] ~]# perl mysqltuner.pl
 >>  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.30
[OK] Operating on 64-bit architecture

-------- Log file Recommendations ------------------------------------------------------------------
[OK] Log file /var/log/mysqld.log exists
[--] Log file: /var/log/mysqld.log(164K)
[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 45 warning(s).
[OK] /var/log/mysqld.log doesn't contain any error.
[--] 12 start(s) detected in /var/log/mysqld.log
[--] 1) 2020-07-08T20:02:04.629641Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2020-07-05T03:08:41.609089Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2020-07-05T02:03:20.472622Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2020-07-05T01:25:04.819401Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2020-07-05T01:08:51.421051Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2020-07-05T00:51:13.342719Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2020-07-05T00:47:39.023346Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2020-07-05T00:41:40.557745Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2020-07-05T00:40:15.990047Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2020-07-05T00:35:33.524672Z 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 11 shutdown(s) detected in /var/log/mysqld.log
[--] 1) 2020-07-08T20:02:02.561780Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2020-07-05T03:08:02.827136Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2020-07-05T02:02:41.224742Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2020-07-05T01:25:03.302258Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2020-07-05T01:08:12.186721Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 6) 2020-07-05T00:50:26.003127Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 7) 2020-07-05T00:47:37.511219Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 8) 2020-07-05T00:41:38.867308Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 9) 2020-07-05T00:40:14.400912Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 10) 2020-07-05T00:35:31.919391Z 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: 58.2M (Tables: 77)
[--] Data in InnoDB tables: 23.1M (Tables: 64)
[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: 9m 39s (538 q [0.929 qps], 83 conn, TX: 2M, RX: 100K)
[--] Reads / Writes: 94% / 6%
[--] Binary logging is disabled
[--] Physical Memory     : 7.6G
[--] Max MySQL memory    : 38.0G
[--] Other process memory: 0B
[--] Total buffers: 93.0M global + 257.1M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 607.2M (7.76% of installed RAM)
[!!] Maximum possible memory usage: 38.0G (497.62% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/538)
[OK] Highest usage of available connections: 1% (2/151)
[!!] Aborted connections: 3.61%  (3/83)
[!!] 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 / 317 selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 18 sorts)
[!!] Joins performed without indexes: 2
[OK] Temporary tables created on disk: 5% (47 on disk / 905 total)
[OK] Thread cache hit rate: 97% (2 created / 83 connections)
[OK] Table cache hit rate: 59% (817 open / 1K opened)
[OK] table_definition_cache(1400) is upper than number of tables(420)
[OK] Open file limit used: 0% (258/40K)
[OK] Table locks acquired immediately: 100% (298 immediate / 298 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: 19.1% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/8.9M
[OK] Read Key buffer hit rate: 95.4% (1K cached / 72 reads)
[OK] Write Key buffer hit rate: 100.0% (24 cached / 24 writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 52.0M/23.1M
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (184.615384615385 %): 48.0M * 2/52.0M should be equal to 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: 91.36% (6694 hits/ 7327 total)
[!!] InnoDB Write Log efficiency: 58.33% (35 hits/ 60 total)
[OK] InnoDB log waits: 0.00% (0 waits / 25 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
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Dedicate this server to your database for highest performance.
    Reduce or eliminate unclosed connections and network issues
    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).
    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)
    performance_schema = ON enable PFS
    innodb_log_file_size should be (=6M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
 

ZenHostingTravis

Well-Known Member
PartnerNOC
May 22, 2020
275
95
28
Australia
cPanel Access Level
Root Administrator
Hi @nicedood,

Do you know if it's an OpenVZ or KVM VPS that you have purchased from GoDaddy?

General performance of a KVM VPS will be much better.

Is the bottleneck the database? Have you checked the slow queries log?

If it was my VPS, I'd look at using Litespeed with LSCache to improve performance amongst other things unless I was certain where the bottleneck was.
 

nicedood

Registered
Jul 8, 2020
2
0
1
CA
cPanel Access Level
Root Administrator
Hi @ZenHostingTravis

I don't think it specifies, I bought the 4vCPU listed here: Get a Managed VPS Hosting Solution - GoDaddy

There really isn't a bottleneck, I just want to configure the performance before it gets to that point.

I just want to prepare before it gets to that.

I just did a quick google search on litespeed with lscache, but only wordpress plugins are popping up, Do you have a link that I can read more about this? Is there a simple command I can run in the terminal to install this on WHM?

Thank you for your response :)
 
Last edited by a moderator:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
While some folks here might be able to provide you with information on optimizing MySQL we can't guarantee it. Your best course of action would be to enlist the assistance of a qualified system administrator. If you don't have one you might find one here: System Administration Services
 

ZenHostingTravis

Well-Known Member
PartnerNOC
May 22, 2020
275
95
28
Australia
cPanel Access Level
Root Administrator
Hi @ZenHostingTravis

I don't think it specifies, I bought the 4vCPU listed here: Get a Managed VPS Hosting Solution - GoDaddy

There really isn't a bottleneck, I just want to configure the performance before it gets to that point.

I just want to prepare before it gets to that.

I just did a quick google search on litespeed with lscache, but only wordpress plugins are popping up, Do you have a link that I can read more about this? Is there a simple command I can run in the terminal to install this on WHM?

Thank you for your response :)
Hi @nicedood,

That's good that you're tweaking your server to get the best performance out of it. Kudos to you.

You'd need to purchase a Litespeed license (they might offer a trial license) and you can install the LSCache plugin to a CMS such as Wordpress.

It's relatively easy to install Litespeed from the command line and the Litespeed team provide good support but obviously it's always best to your testing on a non-production VPS.

If you're interested in testing Nginx, there is a good plugin called Engintron that installs Nginx to cPanel and the author has written a lot of documentation around how to tweak mySQL for performance so you might be interested in reading that.

cPanel is also working on an Nginx release soon. I'm sure @cPanelLauren can tell you more about that, if you're interested in learning more.