Hello all!
I have VPS with running 2.5GB RAM, Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz (cache 15360 KB). It front end Nginx and backend Apache. This VPS run two wordpress sites. First site page preview 3,000-3,500 (daily) second site 500-600 (daily). First site mysql database size is 56.1MB and 2nd site MySQL database size is 10.3MB.
When I'm running ps -aux command, I can see higher RAM usage
When I'm running free -m I receive following output.
When I'm running MySQL tuner, I get following output.
This is my MySQL configuration file (my.cnf):- /http://pastebin.com/x5FwuKiK
How do I reduce MySQL memory usage?
Thanks!
I have VPS with running 2.5GB RAM, Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz (cache 15360 KB). It front end Nginx and backend Apache. This VPS run two wordpress sites. First site page preview 3,000-3,500 (daily) second site 500-600 (daily). First site mysql database size is 56.1MB and 2nd site MySQL database size is 10.3MB.
Code:
[email protected] [~]# mysql --version
mysql Ver 14.14 Distrib 5.5.35, for Linux (i686) using readline 5.1
When I'm running ps -aux command, I can see higher RAM usage
Code:
[email protected] [~]# ps -aux
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mysql 11980 0.4 3.5 755956 93016 ? Sl 07:50 0:05 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql -
When I'm running free -m I receive following output.
Code:
[email protected] [~]# free -m
total used free shared buffers cached
Mem: 2560 1927 632 0 0 1516
-/+ buffers/cache: 410 2149
Swap: 0 0 0
When I'm running MySQL tuner, I get following output.
Code:
[email protected] [~]# ./mysqltuner.pl
>> MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at [url]http://mysqltuner.com/[/url]
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.35-cll
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 66M (Tables: 239)
[--] Data in InnoDB tables: 4M (Tables: 28)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 7
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 21m 18s (22K q [17.603 qps], 380 conn, TX: 97M, RX: 3M)
[--] Reads / Writes: 78% / 22%
[--] Total buffers: 608.0M global + 3.6M per thread (50 max threads)
[OK] Maximum possible memory usage: 786.1M (30% of installed RAM)
[OK] Slow queries: 0% (0/22K)
[OK] Highest usage of available connections: 10% (5/50)
[OK] Key buffer size / total MyISAM indexes: 16.0M/12.9M
[!!] Key buffer hit rate: 93.0% (320K cached / 22K reads)
[OK] Query cache efficiency: 59.8% (11K cached / 18K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1K sorts)
[!!] Joins performed without indexes: 74
[OK] Temporary tables created on disk: 19% (192 on disk / 1K total)
[OK] Thread cache hit rate: 98% (5 created / 380 connections)
[!!] Table cache hit rate: 2% (96 open / 4K opened)
[OK] Open file limit used: 9% (177/1K)
[OK] Table locks acquired immediately: 100% (10K immediate / 10K locks)
[OK] InnoDB data size / buffer pool: 4.9M/384.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
join_buffer_size (> 1.0M, or always use indexes with joins)
table_cache (> 96)
[email protected] [~]#
How do I reduce MySQL memory usage?
Thanks!