LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2017, 06:44 AM   #1
1300
Member
 
Registered: Nov 2011
Posts: 68

Rep: Reputation: Disabled
limiting MySQL cluster memory usage


Guys

my MySQL DB is consuming all RAM capacity available in the server and I want to limit it usage to maximum 80% of RAM

I am using mysql-cluster-community 7.5 on oracle linux 7.4
 
Old 11-01-2017, 05:41 PM   #2
thecarpy
Member
 
Registered: Apr 2005
Location: France
Distribution: Devuan, Suse, Slackware
Posts: 130

Rep: Reputation: 20
You can use cgroups for that.

In /etc/cgconfig.conf:

group memlimit {
memory {
memory.limit_in_bytes = 4294967296;
}
}

Taken from https://unix.stackexchange.com/quest...ited-ram-usage
 
Old 11-01-2017, 08:27 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179
Be careful, however, that you are accurately identifying "an actual problem" when you observe that "<<such_and_such>> is 'consuming all available RAM capacity.'"

"Is anybody actually screaming?" Are other processes being swapped-out, or forced into an involuntary page-wait state for a significant amount of time?

If you are simply observing that the physical-RAM resource is "100% utilized," then this is actually a good thing. "That's what physical-RAM is for," and Linux of course wants to put 100% of it to some productive use, 100% of the time.

Unless there is actual pressure, or contention, for the physical-RAM resource, then Linux will be "utterly lazy" concerning it. The physical-RAM consumption of any process, in an "otherwise un-contested, 'life is good™,' situation," might be considerably overstated: even if the process hasn't referenced that data in several hours, Linux will make no attempt whatsoever to "clean it up." Until it feels "pressured" to do so. This is by design.

- - - - -
One of my past-life employers would very-periodically run a process that would query the system's virtual-memory statistics, then allocate memory in a specific effort to cause "moderate perceived memory pressure." Basically, just enough to cause the OS to actually look for unused pages (in other processes) and "reap" them in order to satisfy the new demand. The process then terminated itself, so that its own allocation would be disposed-of and accounted-for as "free space." This process simply existed to cause the long-term system-utilization statistics (which the company religiously collected, for some reason) to be more accurate. On systems in which memory-pressure did not ordinarily exist, this process periodically induced it.

Last edited by sundialsvcs; 11-01-2017 at 08:32 PM.
 
1 members found this post helpful.
Old 11-02-2017, 08:17 AM   #4
1300
Member
 
Registered: Nov 2011
Posts: 68

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by thecarpy View Post
You can use cgroups for that.

In /etc/cgconfig.conf:

group memlimit {
memory {
memory.limit_in_bytes = 4294967296;
}
}

Taken from https://unix.stackexchange.com/quest...ited-ram-usage
Thanks for your post, it added something to my knowledge

Quote:
Originally Posted by sundialsvcs View Post
Be careful, however, that you are accurately identifying "an actual problem" when you observe that "<<such_and_such>> is 'consuming all available RAM capacity.'"

"Is anybody actually screaming?" Are other processes being swapped-out, or forced into an involuntary page-wait state for a significant amount of time?

If you are simply observing that the physical-RAM resource is "100% utilized," then this is actually a good thing. "That's what physical-RAM is for," and Linux of course wants to put 100% of it to some productive use, 100% of the time.

Unless there is actual pressure, or contention, for the physical-RAM resource, then Linux will be "utterly lazy" concerning it. The physical-RAM consumption of any process, in an "otherwise un-contested, 'life is good™,' situation," might be considerably overstated: even if the process hasn't referenced that data in several hours, Linux will make no attempt whatsoever to "clean it up." Until it feels "pressured" to do so. This is by design.

- - - - -
One of my past-life employers would very-periodically run a process that would query the system's virtual-memory statistics, then allocate memory in a specific effort to cause "moderate perceived memory pressure." Basically, just enough to cause the OS to actually look for unused pages (in other processes) and "reap" them in order to satisfy the new demand. The process then terminated itself, so that its own allocation would be disposed-of and accounted-for as "free space." This process simply existed to cause the long-term system-utilization statistics (which the company religiously collected, for some reason) to be more accurate. On systems in which memory-pressure did not ordinarily exist, this process periodically induced it.
Exactly,, and this is my opinion about the same

swap is empty and I thought if the system is in pressure then I would find swap in high utilization

Thanks alot for your response
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL memory usage tanveer Linux - General 5 12-23-2015 11:50 PM
How to monitor mysql nodes (memory usage) eddiep Linux - Software 7 09-26-2008 10:45 AM
RedHat MySQL memory usage Rezner Linux - Server 4 07-05-2008 12:56 AM
limiting cpu and memory usage by user process amitkush Linux - Security 2 07-04-2003 01:21 AM
Limiting the total amount of memory usage by apache. SplashHost.com Linux - General 8 08-30-2002 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration