Limit linux file cache memory usage (to avoid hypervisor memory exhaustion)Linux memory usagelinux cache usageLimit Apache 2 Memory UsageHow to limit memory usage by application in linux?Avoid linux out-of-memory application teardownMemory Usage in LINUXASP.NET cache trimming aware of app pool memory limit?Is it sensible to use SLC swap as a RAM substitute on a VM host?limit filesystem cache size for specific files under linuxTool for linux file system cache inspection
Is the Indo-European language family made up?
Can I tell a prospective employee that everyone in the team is leaving?
Count Even Digits In Number
Pirate democracy at its finest
Efficient Algorithm for the boundary of a set of tiles
Are black holes spherical during merger?
In general, would I need to season a meat when making a sauce?
Is it truly impossible to tell what a CPU is doing?
Why were helmets and other body armour not commonplace in the 1800s?
Where's this lookout in Nova Scotia?
Can the product of any two aperiodic functions which are defined on the entire number line be periodic?
What are these arcade games in Ghostbusters 1984?
Popcorn is the only acceptable snack to consume while watching a movie
Is the field of q-series 'dead'?
What is a Centaur Thief's climbing speed?
Is it rude to call a professor by their last name with no prefix in a non-academic setting?
Specifying background color seen through semi-transparent surface
Question in discrete mathematics about group permutations
Can a British citizen living in France vote in both France and Britain in the European Elections?
NIntegrate doesn't evaluate
Why does Mjolnir fall down in Age of Ultron but not in Endgame?
Do photons bend spacetime or not?
How to cut a climbing rope?
Why isn't 'chemically-strengthened glass' made with potassium carbonate to begin with?
Limit linux file cache memory usage (to avoid hypervisor memory exhaustion)
Linux memory usagelinux cache usageLimit Apache 2 Memory UsageHow to limit memory usage by application in linux?Avoid linux out-of-memory application teardownMemory Usage in LINUXASP.NET cache trimming aware of app pool memory limit?Is it sensible to use SLC swap as a RAM substitute on a VM host?limit filesystem cache size for specific files under linuxTool for linux file system cache inspection
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a server with 16GB RAM running several linux virtual machines (around 10), which perform several different tasks. These machines, with the default configuration, will fill up the memory I give them to the max with cache.
Even as this is a desirable behavior for physical hosts, on my setup, this cache is actually consuming real host RAM which is not freeable from the host, and forces me to set relatively low amounts of ram to the vms (no more than (16 - host cache)/number of vms
). This is quite undesirable, as the system loses flexibility making impossible to handle sporadic requests of RAM from concrete vms.
The only approach that comes to my mind is to limit the amount of RAM the kernel can use for caching (or make cache expire sooner), but I haven't found any documentation on how to do it. Most forum posts refer to linuxatemyram.com or alike, and I haven't seem any relevant parameter exposed under /proc/sys/vm/ either.
Maybe some can offer some insights on this? I'd be really grateful.
linux virtualization kvm-virtualization cache
add a comment |
I have a server with 16GB RAM running several linux virtual machines (around 10), which perform several different tasks. These machines, with the default configuration, will fill up the memory I give them to the max with cache.
Even as this is a desirable behavior for physical hosts, on my setup, this cache is actually consuming real host RAM which is not freeable from the host, and forces me to set relatively low amounts of ram to the vms (no more than (16 - host cache)/number of vms
). This is quite undesirable, as the system loses flexibility making impossible to handle sporadic requests of RAM from concrete vms.
The only approach that comes to my mind is to limit the amount of RAM the kernel can use for caching (or make cache expire sooner), but I haven't found any documentation on how to do it. Most forum posts refer to linuxatemyram.com or alike, and I haven't seem any relevant parameter exposed under /proc/sys/vm/ either.
Maybe some can offer some insights on this? I'd be really grateful.
linux virtualization kvm-virtualization cache
1
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, setcurrentMemory
smaller thanmemory
– John Mahowald
Feb 25 '17 at 23:52
add a comment |
I have a server with 16GB RAM running several linux virtual machines (around 10), which perform several different tasks. These machines, with the default configuration, will fill up the memory I give them to the max with cache.
Even as this is a desirable behavior for physical hosts, on my setup, this cache is actually consuming real host RAM which is not freeable from the host, and forces me to set relatively low amounts of ram to the vms (no more than (16 - host cache)/number of vms
). This is quite undesirable, as the system loses flexibility making impossible to handle sporadic requests of RAM from concrete vms.
The only approach that comes to my mind is to limit the amount of RAM the kernel can use for caching (or make cache expire sooner), but I haven't found any documentation on how to do it. Most forum posts refer to linuxatemyram.com or alike, and I haven't seem any relevant parameter exposed under /proc/sys/vm/ either.
Maybe some can offer some insights on this? I'd be really grateful.
linux virtualization kvm-virtualization cache
I have a server with 16GB RAM running several linux virtual machines (around 10), which perform several different tasks. These machines, with the default configuration, will fill up the memory I give them to the max with cache.
Even as this is a desirable behavior for physical hosts, on my setup, this cache is actually consuming real host RAM which is not freeable from the host, and forces me to set relatively low amounts of ram to the vms (no more than (16 - host cache)/number of vms
). This is quite undesirable, as the system loses flexibility making impossible to handle sporadic requests of RAM from concrete vms.
The only approach that comes to my mind is to limit the amount of RAM the kernel can use for caching (or make cache expire sooner), but I haven't found any documentation on how to do it. Most forum posts refer to linuxatemyram.com or alike, and I haven't seem any relevant parameter exposed under /proc/sys/vm/ either.
Maybe some can offer some insights on this? I'd be really grateful.
linux virtualization kvm-virtualization cache
linux virtualization kvm-virtualization cache
asked Feb 23 '17 at 14:09
Roberto SantallaRoberto Santalla
3214
3214
1
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, setcurrentMemory
smaller thanmemory
– John Mahowald
Feb 25 '17 at 23:52
add a comment |
1
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, setcurrentMemory
smaller thanmemory
– John Mahowald
Feb 25 '17 at 23:52
1
1
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, set
currentMemory
smaller than memory
– John Mahowald
Feb 25 '17 at 23:52
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, set
currentMemory
smaller than memory
– John Mahowald
Feb 25 '17 at 23:52
add a comment |
1 Answer
1
active
oldest
votes
You can modify the value of /proc/sys/vm/vfs_cache_pressure
to a value greater than 100 (default value). With increased value beyond 100, it
causes the kernel to prefer to reclaim dentries and inodes.
Thanks for your response! Unfortunately, I've already tried to increasevfs_cache_pressure
to1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.
– Roberto Santalla
Feb 24 '17 at 14:41
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f834475%2flimit-linux-file-cache-memory-usage-to-avoid-hypervisor-memory-exhaustion%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can modify the value of /proc/sys/vm/vfs_cache_pressure
to a value greater than 100 (default value). With increased value beyond 100, it
causes the kernel to prefer to reclaim dentries and inodes.
Thanks for your response! Unfortunately, I've already tried to increasevfs_cache_pressure
to1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.
– Roberto Santalla
Feb 24 '17 at 14:41
add a comment |
You can modify the value of /proc/sys/vm/vfs_cache_pressure
to a value greater than 100 (default value). With increased value beyond 100, it
causes the kernel to prefer to reclaim dentries and inodes.
Thanks for your response! Unfortunately, I've already tried to increasevfs_cache_pressure
to1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.
– Roberto Santalla
Feb 24 '17 at 14:41
add a comment |
You can modify the value of /proc/sys/vm/vfs_cache_pressure
to a value greater than 100 (default value). With increased value beyond 100, it
causes the kernel to prefer to reclaim dentries and inodes.
You can modify the value of /proc/sys/vm/vfs_cache_pressure
to a value greater than 100 (default value). With increased value beyond 100, it
causes the kernel to prefer to reclaim dentries and inodes.
answered Feb 23 '17 at 14:35
KhaledKhaled
31.6k65487
31.6k65487
Thanks for your response! Unfortunately, I've already tried to increasevfs_cache_pressure
to1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.
– Roberto Santalla
Feb 24 '17 at 14:41
add a comment |
Thanks for your response! Unfortunately, I've already tried to increasevfs_cache_pressure
to1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.
– Roberto Santalla
Feb 24 '17 at 14:41
Thanks for your response! Unfortunately, I've already tried to increase
vfs_cache_pressure
to 1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.– Roberto Santalla
Feb 24 '17 at 14:41
Thanks for your response! Unfortunately, I've already tried to increase
vfs_cache_pressure
to 1000
, and the results are still the same. All the available RAM is sucked by the cache in terms of five minutes.– Roberto Santalla
Feb 24 '17 at 14:41
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f834475%2flimit-linux-file-cache-memory-usage-to-avoid-hypervisor-memory-exhaustion%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It sounds like you are trying to overcommit memory. This is generally not a good idea.
– Michael Hampton♦
Feb 23 '17 at 14:50
It also sounds like you are trying to squeeze more out of the physical host than it can handle. You can't beat the laws of physics, at some point you have to get more resources in that machine. Having said that, have you tried to use KSM and balooning?
– dyasny
Feb 23 '17 at 18:52
You are correct, I plan to give the hosts more maximum RAM than the system has. This should't be a problem if cache usage is limited, as all the virtual machines using 100% of RAM is a very unlikely scenario.
– Roberto Santalla
Feb 24 '17 at 14:44
On the contrary, one or two GB RAM will be quickly used by a modern guest. The hypervisor has no way of knowing much of it is caches and can be reclaimed. You could try ballooning in the guest. In libvirt terminology, set
currentMemory
smaller thanmemory
– John Mahowald
Feb 25 '17 at 23:52