Hello,
I have a big performanceproblem with my kvm-server. It is running cPanel 11.58 - ea-apache24-mod_mpm_worker - MariaDB 10.0
I have some tables in one database with more than 1.000.000 enties. This database is very large; the engines are mixed - innoDB and MyISAM.
When I ran HTOP all 4 cores are running at 100% all the time with php-cgi command using the CPU.
When I run mysqltuner.pl this is the output:
my my.cnf
So my question is, where to start searching for the problem.
Can anyone help me and give me tips to optimize PHP and mysql?
I have a big performanceproblem with my kvm-server. It is running cPanel 11.58 - ea-apache24-mod_mpm_worker - MariaDB 10.0
I have some tables in one database with more than 1.000.000 enties. This database is very large; the engines are mixed - innoDB and MyISAM.
When I ran HTOP all 4 cores are running at 100% all the time with php-cgi command using the CPU.
When I run mysqltuner.pl this is the output:
Code:
>> MySQLTuner 1.6.18 - 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
[!!] Currently running unsupported MySQL version 10.0.27-MariaDB
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in Aria tables: 1M (Tables: 2)
[--] Data in MyISAM tables: 776M (Tables: 249)
[--] Data in InnoDB tables: 938M (Tables: 1464)
[--] Data in MEMORY tables: 0B (Tables: 2)
[OK] Total fragmented tables: 0
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] User 'munin@localhost' has user name as password.
[--] There are 612 basic passwords in the list.
-------- CVE Security Recommendations --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 27s (246 q [9.111 qps], 24 conn, TX: 1M, RX: 38K)
[--] Reads / Writes: 96% / 4%
[--] Binary logging is disabled
[--] Physical Memory : 7.7G
[--] Max MySQL memory : 7.1G
[--] Other process memory: 1.5G
[--] Total buffers: 1.1G global + 40.8M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 1.2G (15.02% of installed RAM)
[!!] Maximum possible memory usage: 7.1G (92.21% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/246)
[OK] Highest usage of available connections: 1% (2/151)
[!!] Aborted connections: 4.17% (1/24)
[!!] Query cache may be disabled by default due to mutex contention.
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 31 sorts)
[!!] Joins performed without indexes: 2
[OK] Temporary tables created on disk: 18% (5 on disk / 27 total)
[OK] Thread cache hit rate: 91% (2 created / 24 connections)
[OK] Table cache hit rate: 208% (121 open / 58 opened)
[OK] Open file limit used: 0% (24/10K)
[OK] Table locks acquired immediately: 100% (244 immediate / 244 locks)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 4 thread(s).
[--] Using default value is good enough for your version (10.0.27-MariaDB)
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.2% (12M used / 67M cache)
[!!] Key buffer size / total MyISAM indexes: 64.0M/269.1M
-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/160.0K
[OK] Aria pagecache hit rate: 96.2% (52 cached / 2 reads)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 768.0M/938.5M
[OK] InnoDB buffer pool instances: 1
[--] InnoDB Buffer Pool Chunk Size not used or defined in your version
[OK] InnoDB Read buffer efficiency: 97.94% (80459 hits/ 82151 total)
[!!] InnoDB Write Log efficiency: 76.47% (26 hits/ 34 total)
[OK] InnoDB log waits: 0.00% (0 waits / 8 writes)
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server.
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Set up a Secure Password for user@host ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' = PASSWORD('secure_password'); )
MySQL started within 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
Adjust your join queries to always utilize indexes
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_type (=0)
join_buffer_size (> 32.0M, or always use indexes with joins)
key_buffer_size (> 269.1M)
innodb_buffer_pool_size (>= 938M) if possible.
Code:
[mysqld]
performance-schema=0
bind-address=127.0.0.1
skip_name_resolve
local-infile=0
# MyISAM-Einträge
tmp_table_size=75M
max_heap_table_size=75M # beide Einträge verdoppelt - 20.07.2016 - 64M pro GB
query_cache_limit = 50M
query_cache_size = 50M #512MB - 28.07.2016 768M -> 128M
key_buffer_size=64M #48MB - 17.01.2014 128M - 05.02.2016 96MB - 28.07.2016 64M - 08.09.2016 48MB - 64M 13.09.2016
join_buffer_size=32M # erhöht 512 - 768 - 11.08.2016 - 8M 05.09.2016 - 32M 13.09.2016
query_cache_type = 0
# InnoDB-Einträge
default-storage-engine = InnoDB
innodb_file_per_table=1
query_cache_type = 1 # query_cache aus für innoDB
innodb_buffer_pool_size = 768M #Eintrag lt. mysqltuner - 11.08.2016 1G - 05.09.2016 1G - 768M 13.09.2016
innodb_buffer_pool_instances = 1 # Anzahl der Cores
wait_timeout=60 # löscht Sleep-Connections - default 28800
table_cache=4096 # das Gleiche wie table_open_cache - nur eins verwenden!
sort_buffer_size=256k
read_buffer_size=256k
read_rnd_buffer_size=8M
myisam_sort_buffer_size=128M
thread_cache_size=16
table_definition_cache=3500
# Logs bremsen den Server aus und produzieren viele Daten
log-queries-not-using-indexes=0
log-error = "/var/log/mysql/server.ws-s.de.err"
# engine-condition-pushdown
open_files_limit=10000
log-output=FILE
max_allowed_packet=268435456
query_cache_min_res_unit = 4096
Can anyone help me and give me tips to optimize PHP and mysql?