woebegone
By:
woebegone

Something strange about msqld memory usage

July 27, 2014 1.4k views

Hello,

Newbie here.

I run my VPS on CentOS 7. I just setup LAMP (with mariadb), phpMyAdmin and PPTP for VPN server. Just pure setup. I didn't create another php file or database.

I run "top" command and watch some time. I just realize that mysqld process running every 25 seconds, shows up only 3 seconds and then disappear. This happens every 25 seconds and looks like below:

PID USER PR VIRT %CPU %MEM COMMAND
1152 mysql 20 847188 0,7 18,4 mysqld

What is the reason of that? Is it a some kind of memory leak? Is there any way to optimize mysql to avoid this problem?

Thanks for your help

P.s. That would be great if we can add images to questions.

1 comment
  • The mysqld process should be running the whole time but as it's resource usage changes it may appear and disappear from your view in "top" depending on how you have it sorted. MySQL/MariaDB will reserve a fairly large amount of RAM for itself and this can sometimes pose problems on 512MB droplets. If you are running on a 512MB droplet you may want to consider enabling a swap file on your droplet. The tutorial below will walk you through this process:

    https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

    by Justin Ellingwood
    Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
1 Answer

This question was answered by @ryanpq:

The mysqld process should be running the whole time but as it's resource usage changes it may appear and disappear from your view in "top" depending on how you have it sorted. MySQL/MariaDB will reserve a fairly large amount of RAM for itself and this can sometimes pose problems on 512MB droplets. If you are running on a 512MB droplet you may want to consider enabling a swap file on your droplet. The tutorial below will walk you through this process:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

View the original comment

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
Have another answer? Share your knowledge.