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 |
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 |
Be careful, however, that you are accurately identifying "an actual problem" when you observe that "<<such_and_such>> is 'consuming all available RAM capacity.'" :eek:
"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. |
Quote:
Quote:
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 |
All times are GMT -5. The time now is 08:45 AM. |