Mysql high memory usage

BrianUK

Verified User
Joined
Feb 4, 2006
Messages
89
I'm running debian 7 64 bit on a vps currently memory usage is showing as

free -m shows
Code:
                 total       used       free     shared    buffers     cached
Mem:          4001       2409       1591          0          0       1750
-/+ buffers/cache:       658       3342
Swap:         4000        219       3780

but htop shows
Code:
Mem[||||||||||*************************           671/4001MB]
  Swp[||||                                          219/4000MB]

ps -eF --sort -rss
Code:
UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
mysql     1883  1469  1 251046 320472 0 May27 ?        03:42:26 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/us

top
Code:
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                               
                                                               
 1883 mysql     20   0  980m 312m 8356 S   1.7  7.8 222:27.33 mysqld

ps -C mysqld -O rss
Code:
PID   RSS S TTY          TIME COMMAND
 1883 320472 S ?       03:42:27 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=

cat /etc/my.cnf
Code:
[mysqld]
local-infile=0
innodb_file_per_table

as far as i can see it's mostly mysql using it, any help would be appreciated.
 
Hello,

Does it make you any trouble? Unless you've got issues with other services (PHP scripts fail or SWAP high usage, or anything else related to RAM) I don't think you need to worry about it. Check this: http://www.linuxatemyram.com/ and this:

Code:
cat /proc/meminfo

Of course you might want to reduce RAM available for MySQL, but that might slow down some queries. If you don't use InnoDB (in MySQL) you might want to disable it.
 
Yes it causes mysql connection errors on phpbb forums

Code:
MemTotal:        4097024 kB
MemFree:         1609260 kB
Cached:          1796512 kB
Buffers:               0 kB
Active:           585996 kB
Inactive:        1880064 kB
Active(anon):     317068 kB
Inactive(anon):   352480 kB
Active(file):     268928 kB
Inactive(file):  1527584 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4096000 kB
SwapFree:        3871204 kB
Dirty:               172 kB
Writeback:             0 kB
AnonPages:        669548 kB
Shmem:              3300 kB
Slab:              21664 kB
SReclaimable:       3540 kB
SUnreclaim:        18124 kB
 
Back
Top