Editing Setting UBC parameters
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | {{ | + | {{UBC toc}} |
[http://forum.swsoft.com/showthread.php?threadid=26770 This thread] has been summarized here on this page. | [http://forum.swsoft.com/showthread.php?threadid=26770 This thread] has been summarized here on this page. | ||
To keep it simple as close to the original format, it is in the form of questions and answers. | To keep it simple as close to the original format, it is in the form of questions and answers. | ||
− | === Question: I want to know how much RAM is allocated to a particular | + | === Question: I want to know how much RAM is allocated to a particular VE. I ran cat /proc/user_beancounters from inside my VPS and I have the following results below. But I am not sure how to interpret the results. === |
<code> | <code> | ||
Line 52: | Line 52: | ||
oomguarpages 59239 59367 125000 2147483647 0 | oomguarpages 59239 59367 125000 2147483647 0 | ||
</code> | </code> | ||
− | The guarantee is vmguarpages barrier = 125000 pages. In any case, the | + | The guarantee is vmguarpages barrier = 125000 pages. In any case, the VPS will be able to allocate that size of memory. Well... in almost any case, with one exception... |
− | ...when the whole node is in out of memory situation. In that case, the guarantee is oomguarpages barrier (the same 125000 pages in this example). It means that no | + | ...when the whole node is in out of memory situation. In that case, the guarantee is oomguarpages barrier (the same 125000 pages in this example). It means that no VPS process will be killed if memory usage by the VPS is less than 125000 * 4096 bytes. If it is more, some process can be killed, and failcounter of oomguarpages will be increased. |
Maximum size of memory which can be allocated is defined by privvmpages (see my previous post). | Maximum size of memory which can be allocated is defined by privvmpages (see my previous post). | ||
Line 70: | Line 70: | ||
You are a bit wrong here. Let me explain it more carefully. | You are a bit wrong here. Let me explain it more carefully. | ||
− | vmguarpages barrier is a guarantee: in any case (except out-of-memory aka OOM) you will be able to allocate 125000 pages. Well, probably you will be able to allocate more, up to 750000 pages (and if you are cool high priority process, you will be able to allocate 825000 pages, but definitely not more). We don't say anything about RAM or SWAP here. These pages can be swapped by HWnode kernel if needed, and can live in RAM if possible. Frankly, you can't say "I want this | + | vmguarpages barrier is a guarantee: in any case (except out-of-memory aka OOM) you will be able to allocate 125000 pages. Well, probably you will be able to allocate more, up to 750000 pages (and if you are cool high priority process, you will be able to allocate 825000 pages, but definitely not more). We don't say anything about RAM or SWAP here. These pages can be swapped by HWnode kernel if needed, and can live in RAM if possible. Frankly, you can't say "I want this VPS to have X MB RAM and Y MB SWAP". There is no such parameter. |
vmguarpages does not account anything, so its current usage always equals to zero. | vmguarpages does not account anything, so its current usage always equals to zero. | ||
Line 76: | Line 76: | ||
oomguarpages parameter's 'current usage' field accounts total amount of RAM+SWAP used. | oomguarpages parameter's 'current usage' field accounts total amount of RAM+SWAP used. | ||
− | physpages parameter accounts total amount of RAM used by the | + | physpages parameter accounts total amount of RAM used by the VPS (the memory shared between VPSes is divided and accounted in physpages for all VPSes which use it in equal fractions). It cannot be limited, it just shows the current situation. |
Let's do some math here. | Let's do some math here. | ||
Line 105: | Line 105: | ||
kmemsize current value: 5125208 bytes | kmemsize current value: 5125208 bytes | ||
− | the sum is 247869844 bytes. If this sum is more than oomguarpages barrier = 125000 pages = 512000000 bytes (it is not), some of the processes on the | + | the sum is 247869844 bytes. If this sum is more than oomguarpages barrier = 125000 pages = 512000000 bytes (it is not), some of the processes on the VPS can be killed in case of OOM situation. |
− | === Question: Is there a way to know for a | + | === Question: Is there a way to know for a VPS account holder (me) that a server has reached an OOM situation? === |
− | 'free' inside a | + | 'free' inside a VPS will show memory statistics for the hardware node (total memory, used memory, total swap, used swap). It's OK for Linux system to use as much RAM as possible, so free memory size is going to be not more than a few megabytes. |
=== Are you aware of a script that would run as a cron job and do the OOM math on a regular basis and email me if I've hit the red zone or maybe at 85-90%? === | === Are you aware of a script that would run as a cron job and do the OOM math on a regular basis and email me if I've hit the red zone or maybe at 85-90%? === | ||
We don't have such script but you can just take a look at the last column of /proc/user_beancounters. Nonzero values there mean that resource allocations were rejected. | We don't have such script but you can just take a look at the last column of /proc/user_beancounters. Nonzero values there mean that resource allocations were rejected. | ||
− | + | === Can you please elaborate the difference between oomguarpages and privvmpages?=== | |
− | + | Both seem to be showing mem + swap. Is the difference between two about allocated but not used pages? I mean, privvmpages show allocated (some of which might not be used) for mem + swap, whereas oomguarpages show allocated, all of which are used, mem + swap? ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | === Can you please elaborate the difference between oomguarpages and privvmpages? === | ||
− | |||
− | Both seem to be showing mem + swap. Is the difference between two about allocated but not used pages? I mean, privvmpages show allocated (some of which might not be used) for mem + swap, whereas oomguarpages show allocated, all of which are used, mem + swap? | ||
− | |||
==== Answer: ==== | ==== Answer: ==== | ||
Yes, oomguarpages current value shows actual usage of MEM+SWAP. | Yes, oomguarpages current value shows actual usage of MEM+SWAP. |