Sziasztok.
Egy kis hobbi blogot futtatok a VPSen és nem értem miért használ 400MB+ memóriát a MySQL.
A MySQLTuner szerint 144.2MB fölé nem kéne mennie.
Kód:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1481 mysql 20 0 1229716 422424 6416 S 0.0 41.5 0:51.10 mysqld
Kód:
Private + Shared = RAM used Program
411.7 MiB + 302.5 KiB = 412.0 MiB mysqld
156.0 KiB + 22.5 KiB = 178.5 KiB mysqld_safe
Kód:
-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 4h 44m 0s (23K q [0.228 qps], 3K conn, TX: 144M, RX: 2M)
[--] Reads / Writes: 97% / 3%
[--] Binary logging is disabled
[--] Total buffers: 88.0M global + 1.1M per thread (50 max threads)
[OK] Maximum reached memory usage: 91.4M (9.19% of installed RAM)
[OK] Maximum possible memory usage: 144.2M (14.51% of installed RAM)
[OK] Slow queries: 0% (0/23K)
[OK] Highest usage of available connections: 6% (3/50)
[OK] Aborted connections: 0.25% (8/3252)
[OK] Query cache efficiency: 79.2% (11K cached / 14K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 41 sorts)
[OK] Temporary tables created on disk: 9% (235 on disk / 2K total)
[OK] Thread cache hit rate: 99% (3 created / 3K connections)
[!!] Table cache hit rate: 17% (467 open / 2K opened)
[OK] Open file limit used: 4% (41/1K)
[OK] Table locks acquired immediately: 100% (1K immediate / 1K locks)
-------- MyISAM Metrics -----------------------------------------------------
[!!] Key buffer used: 18.3% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/41.0K
[OK] Read Key buffer hit rate: 97.8% (324 cached / 7 reads)
-------- InnoDB Metrics -----------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB buffer pool / data size: 32.0M/2.3M
[OK] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 28.97% (593 used/ 2047 total)
[OK] InnoDB Read buffer efficiency: 98.13% (27805 hits/ 28336 total)
[!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total)
[OK] InnoDB log waits: 0.00% (0 waits / 152 writes)
-------- AriaDB Metrics -----------------------------------------------------
[--] AriaDB is disabled.
-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..
-------- Recommendations -----------------------------------------------------
General recommendations:
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Beware that open_files_limit (1024) variable
should be greater than table_open_cache ( 482)
Variables to adjust:
table_open_cache (> 482)
Kód:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
explicit_defaults_for_timestamp
performance_schema = 0
innodb_flush_method = O_DIRECT
innodb_buffer_pool_size = 32M
#slow-query-log = 1
#slow-query-log-file = /var/log/mysql/mysql-slow.log
#long_query_time = 1
#log-queries-not-using-indexes
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
query_cache_size = 16M
query_cache_type=1
query_cache_limit= 2M
max_connections=50
!includedir /etc/mysql/conf.d/
Könyvjelzők