Sunday, November 27, 2022
HomeWordPress Developmentapache - MySQL's most reminiscence utilization is dangerously excessive / php-cgi overloads...

apache – MySQL’s most reminiscence utilization is dangerously excessive / php-cgi overloads CPU


Once I’m utilizing https://httpstatus.io/ to verify the HTTP standing of let’s keep 30 URLs, the server crashes and solely the primary 5-6 photographs return 200, the others return a server error.

Utilizing “high” command in Apache for the time being I set off the request of 30 URLs, 5-6 situations of php-cgi seem on the high, every loading the CPU with over 5%. I’ve a WordPress web site.

I am guessing these two are associated to one another? The truth that MySQL’s most reminiscence utilization is dangerously excessive and the php-cgi overloads the CPU leading to server crashes?

My server settings:

vCPU/s:1 vCPU
RAM:2048.00 MB
Storage: 64 GB NVMe

The MySQL Tuner:

perl mysqltuner.pl
 >>  MySQLTuner 2.0.9
         * Jean-Marie Renouard <jmrenouard@gmail.com>
         * Main Hayden <main@mhtx.web>
 >>  Bug studies, characteristic requests, and downloads at http://mysqltuner.pl/
 >>  Run with '--help' for extra choices and output filtering

[--] Skipped model verify for MySQLTuner script
[OK] At the moment working supported MySQL model 5.7.40-log
[OK] Working on 64-bit structure

-------- Log file Suggestions ------------------------------------------------------------------
[OK] Log file /var/log/mysqld.log exists
[--] Log file: /var/log/mysqld.log (5M)
[OK] Log file /var/log/mysqld.log isn't empty
[OK] Log file /var/log/mysqld.log is smaller than 32 Mb
[OK] Log file /var/log/mysqld.log is readable.
[!!] /var/log/mysqld.log comprises 4595 warning(s).
[!!] /var/log/mysqld.log comprises 1470 error(s).
[--] 126 begin(s) detected in /var/log/mysqld.log
[--] 1) 2022-11-26T16:51:46.008951Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 2) 2022-11-26T14:25:04.411192Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 3) 2022-11-26T14:00:44.505181Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 4) 2022-11-26T13:41:24.726384Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 5) 2022-11-26T13:30:30.052935Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 6) 2022-11-26T13:14:52.946860Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 7) 2022-11-26T13:10:52.597525Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 8) 2022-11-26T13:06:44.314567Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 9) 2022-11-26T12:59:06.893587Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 10) 2022-11-26T12:56:43.639611Z 0 [Note] /usr/sbin/mysqld: prepared for connections.
[--] 47 shutdown(s) detected in /var/log/mysqld.log
[--] 1) 2022-11-26T16:51:45.487321Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 2) 2022-11-26T14:25:03.877227Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 3) 2022-11-26T14:00:44.020059Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 4) 2022-11-26T14:00:41.779016Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 5) 2022-11-26T13:37:23.080832Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 6) 2022-11-26T13:37:22.580337Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 7) 2022-11-26T13:37:22.111923Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 8) 2022-11-26T13:37:21.666683Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 9) 2022-11-26T13:37:21.130343Z 0 [Note] /usr/sbin/mysqld: Shutdown full
[--] 10) 2022-11-26T13:30:29.577245Z 0 [Note] /usr/sbin/mysqld: Shutdown full

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Standing: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Information in MyISAM tables: 200.8M (Tables: 137)
[--] Information in InnoDB tables: 16.0K (Tables: 1)
[OK] Complete fragmented tables: 0

-------- Evaluation Efficiency Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates throughout querying INFORMATION_SCHEMA.

-------- Views Metrics -----------------------------------------------------------------------------

-------- Triggers Metrics --------------------------------------------------------------------------

-------- Routines Metrics --------------------------------------------------------------------------

-------- Safety Suggestions ------------------------------------------------------------------
[OK] No Position person detected
[OK] There are not any nameless accounts for any database customers
[OK] All database customers have passwords assigned
[!!] There isn't a fundamental password file checklist!

-------- CVE Safety Suggestions --------------------------------------------------------------
[--] Skipped attributable to --cvefile choice undefined

-------- Efficiency Metrics -----------------------------------------------------------------------
[--] Up for: 14m 56s (5K q [6.276 qps], 182 conn, TX: 48M, RX: 731K)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Bodily Reminiscence     : 1.8G
[--] Max MySQL reminiscence    : 13.4G
[--] Different course of reminiscence: 0B
[--] Complete buffers: 682.0M world + 260.6M per thread (50 max threads)
[--] Performance_schema Max reminiscence utilization: 0B
[--] Galera GCache Max reminiscence utilization: 0B
[!!] Most reached reminiscence utilization: 1.7G (93.83% of put in RAM)
[!!] Most attainable reminiscence utilization: 13.4G (746.15% of put in RAM)
[!!] Total attainable reminiscence utilization with different course of exceeded reminiscence
[OK] Gradual queries: 0% (0/5K)
[OK] Highest utilization of obtainable connections: 8% (4/50)
[OK] Aborted connections: 0.55% (1/182)
[!!] CPanel and Flex system skip-name-resolve must be on
[OK] Question cache is disabled by default attributable to mutex competition on multiprocessor machines.
[OK] Types requiring non permanent tables: 0% (0 temp types / 1K types)
[OK] No joins with out indexes
[OK] Non permanent tables created on disk: 13% (544 on disk / 4K whole)
[OK] Thread cache hit fee: 97% (4 created / 182 connections)
[OK] Desk cache hit fee: 61% (8K hits / 14K requests)
[OK] table_definition_cache (912) is larger than variety of tables (418)
[OK] Open file restrict used: 1% (780/40K)
[OK] Desk locks acquired instantly: 100% (5K speedy / 5K locks)

-------- Efficiency schema ------------------------------------------------------------------------
[!!] Performance_schema must be activated.
[--] Sys schema is put in.

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

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.8% (24.1M used / 128.0M cache)
[OK] Key buffer measurement / whole MyISAM indexes: 128.0M/11.6M
[OK] Learn Key buffer hit fee: 99.1% (80K cached / 734 reads)
[OK] Write Key buffer hit fee: 100.0% (166 cached / 166 writes)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per desk is activated
[OK] InnoDB buffer pool / knowledge measurement: 512.0M / 16.0K
[!!] Ratio InnoDB log file measurement / InnoDB Buffer pool measurement (6.25%): 16.0M * 2 / 512.0M must be equal to 25%
[OK] InnoDB buffer pool situations: 1
[--] Variety of InnoDB Buffer Pool Chunk: 4 for 1 Buffer Pool Occasion(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Learn buffer effectivity: 97.50% (15884 hits / 16291 whole)
[!!] InnoDB Write Log effectivity: 0% (2 hits / 0 whole)
[OK] InnoDB log waits: 0.00% (0 waits / 2 writes)

-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine not accessible.

-------- 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 assist enabled: ON
[--] Semi synchronous replication Grasp: Not Activated
[--] Semi synchronous replication Slave: Not Activated
[--] It is a standalone server

-------- Suggestions ---------------------------------------------------------------------------
Normal suggestions:
    Examine warning line(s) in /var/log/mysqld.log file
    Examine error line(s) in /var/log/mysqld.log file
    MySQL was began throughout the final 24 hours: suggestions could also be inaccurate
    Scale back your general MySQL reminiscence footprint for system stability
    Dedicate this server to your database for highest efficiency.
    identify decision is enabled attributable to cPanel does not assist this disabled.
    Efficiency schema must be activated for higher diagnostics
    Earlier than altering innodb_log_file_size and/or innodb_log_files_in_group learn this: https://bit.ly/2TcGgtU
Variables to regulate:
  *** MySQL's most reminiscence utilization is dangerously excessive ***
  *** Add RAM earlier than growing MySQL buffer variables ***
    skip-name-resolve=0
    performance_schema=ON
    key_buffer_size (~ 25M)
    innodb_log_file_size must be (=64M) if attainable, so InnoDB whole log recordsdata measurement equals 25% of buffer pool measurement.

CNF

[mysqld]
performance-schema=0

# Disabling symbolic-links is really helpful to stop assorted safety dangers
symbolic-links=0

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

innodb_buffer_pool_size = 500M
innodb_flush_log_at_trx_commit  = 1
innodb_log_file_size = 16M
# innodb_additional_mem_pool_size = 32M
innodb_buffer_pool_instances = 1
innodb_log_buffer_size = 10M

max_connections = 50
wait_timeout = 3600
interactive_timeout = 3600

join_buffer_size = 2M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
key_buffer_size = 128M
max_allowed_packet=268435456
read_rnd_buffer_size = 256K
# thread_stac = 256K
thread_cache_size = 8
open_files_limit = 3000
table_open_cache = 1024
default-storage-engine = MyISAM
innodb_file_per_table = 1

query_cache_type = 0
query_cache_limit = 0
query_cache_size = 0

max_heap_table_size = 32M
tmp_table_size = 32M

general_log_file = /var/log/mysql/mysql.log
general_log = 0

slow-query-log = 1
slow-query-log-file = /var/log/mysql/mysql-slow.log
long_query_time = 1
log-queries-not-using-indexes = 1

I discovered one thing about utilizing “slow-query-log” to debug the causes however I am tremendous not with these items and I could not perceive a lot of it.

If somebody can information me I would very a lot admire it!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments