LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 06-22-2013, 09:03 AM   #1
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Rep: Reputation: 1
MariaDB/MySQL uses too much RAM


Hello,

I have migrated my debian server from squeeze to wheezy and mysql to mariadb. The problem is that mysql starts eating up all my RAM and I am not able to run other programs (another app in NodeJS is killed for instance).
I have several services using mysql on it but I am not sure it's even this.

I have tried stopping all other services on the server (apache, varnish, node, prosody, etc.) to be sure it's not used by something else and relaunching mysql

Code:
# free -m
             total       used       free     shared    buffers     cached
Mem:          1981        298       1682          0          0        296
-/+ buffers/cache:          2       1979
Swap:            0          0          0
# service mysql start
Starting MariaDB database server: mysqld . ..
Checking for corrupt, not cleanly closed and upgrade needing tables..
# free -m
             total       used       free     shared    buffers     cached
Mem:          1981       1093        888          0          0        296
-/+ buffers/cache:        796       1184
Swap:            0          0          0
Here there is 888MB free but nothing is left after if other services are running.

Looks like everything goes in the buffers/cache. How can I stop or at least reduce this problematic behaviour ?

/etc/mysql/my.cnf

Thanks

Last edited by martvefun; 06-22-2013 at 09:08 AM.
 
Old 06-22-2013, 01:36 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,530

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
What happens when you enable swap? If you do not have a swap partition then create a swap file.
 
Old 06-23-2013, 04:41 AM   #3
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Original Poster
Rep: Reputation: 1
Actually it's an OpenVZ virtual machine running in a Proxmox environment (I should probably have mentioned that). I have 1GB of RAM and 1GB of SWAP configured. If I increase the swap size, the memory line will directly increase, not the swap.

I can increase the swap but I am not sure it is the solution. I used to be able to run all my services and now that I have made the switch to MariaDB it seems to have increase the memory usage. I don't have other choices to shut down mysql service to be able to run mongodb (I used to have both running at the same time).
 
Old 06-23-2013, 08:50 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,530

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
I a minor detail... No actual experience with running OpenVZ but there there are some suggestions on how to tweak MariaDB/MySQL memory usage like the following. Might help you some. Another suggest is to use MyISAM instead of InnoDD.

http://opensourcehacker.com/2011/03/...-debian-linux/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] New MariaDB as replacement for Mysql vdemuth Slackware 10 03-31-2013 09:05 AM
Replace MySQL with MariaDB in Slackware abesirovic1 Slackware 36 03-28-2013 08:53 AM
LXer: Fedora 19: MariaDB instead of MySQL, but no Btrfs LXer Syndicated Linux News 0 02-01-2013 10:10 AM
LXer: Wikipedia moving from MySQL to MariaDB LXer Syndicated Linux News 0 12-17-2012 10:42 PM


All times are GMT -5. The time now is 02:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration