Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
we have several clusters used for high performance computing.
The cluster nodes have 48GB memory and on each there is 2GB swap available.
What I would like to avoid is the usage of swap as long as there is enough free memory or empty the swap as soon as there is a free memory.
I thought that this could be achieved by setting the swapiness to 0, but although it helped a bit, it still didn't solve the problem completely.
Even with swapiness set to 0, my memory usage looks like this:
If there is (still) data in swap with that config, it likely isn't a performance impact.
You could simply swapoff/swapon to "fix" it quickly. Let's see
If there is (still) data in swap with that config, it likely isn't a performance impact.
You could simply swapoff/swapon to "fix" it quickly. Let's see
Code:
uname -a
cat /proc/meminfo
Hi,
it surely has no performance effect. But this may happen on any of the clusters we have. And the swap usage is being monitored. And of course I want to know when really the swap usage is an issue just because the system is running out of memory.
Like this I'm getting warning messages also for systems, which have plenty of free memory, but still use swap.
Like this one for example:
it surely has no performance effect. But ... swap usage is being monitored.
Quote:
Originally Posted by dubak
Hi, isn't there really anyone who would know how to solve this?
Solve it by monitoring some more meaningful measure of memory pressure, and ignoring the swap space used.
The rate of physical swap-in I/O can be monitored and that is a significant measure (some low threshold like 100 swap-in I/Os per minute should be ignored and be sure to look at physical, not "soft" swap-in). But with 48GB ram and only 2GB swap, your system will be in pretty bad shape before swap activity could be used as a measure of memory pressure.
Is the issue here that you're getting warning messages that you shouldn't be? Or maybe too many false alarms from the warning system?
"The use of swap space" is not, categorically, a sign of alarm. What is significant is a large number of processes that are spending a noticeable percentage of their time in a swap-wait state.
The kernel uses swap space for many reasons, even when RAM availability is not an issue. Therefore, measurement of "the amount of swap space that is in use right now" might not be particularly useful as a metric.
The only two metrics that you really want to be alerted to are: (1) "The ship is actually sinking," or (2) "There is an actual fire that is actually very smoky and very hot." These are metrics that focus upon effects first, and symptoms second. A red spot on your arm is one thing; a red spot that hurts when you touch it is another.
Last edited by sundialsvcs; 05-26-2011 at 07:09 AM.
This seems to be a typical Linux problem where it grabs unused pages from running programs to use them for buffering/caching disk I/O (even if it causes swapping, even if swappiness=0).
There's a "drop cache" command that might help (misnamed, it's really a clear cache). See http://linux-mm.org/Drop_Caches for details.
Re: drop caches is misunderstanding of the way Linux uses memory
Respectfully, I disagree. On our dedicated 48gbyte data warehousing system, we leave 10 gbytes of free memory on the system. But Linux still grabs memory from running processes and swaps out about 12g bytes of ram in order to allocate that memory to the free/buffered categories (the memory sloshes back and forth between these categories). Linux is using this memory to buffer terabytes of data read & write activity which don't need to be buffered (or at least don't need to be buffered this much). When the partially swapped out process suddenly starts accessing the swapped out memory, the I/O (via kswapd activity) causes slowdowns.
Having said that, dropping (clearing) cache probably won't help once the memory has been allocated, because it just goes back to the free category and doesn't free up already used swap. Maybe something like swapoff?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.