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;








1















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.










share|improve this question

















  • 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 than memory

    – John Mahowald
    Feb 25 '17 at 23:52

















1















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.










share|improve this question

















  • 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 than memory

    – John Mahowald
    Feb 25 '17 at 23:52













1












1








1








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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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, set currentMemory smaller than memory

    – John Mahowald
    Feb 25 '17 at 23:52












  • 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 than memory

    – 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










1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer























  • 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












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
);



);













draft saved

draft discarded


















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









0














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.






share|improve this answer























  • 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
















0














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.






share|improve this answer























  • 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














0












0








0







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 23 '17 at 14:35









KhaledKhaled

31.6k65487




31.6k65487












  • 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

















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


















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company