Swap Full But Memory Available In RAM
I've a AWS ec2 instance running Ubuntu 16.04 with 64 GB RAM and have a swap file configured for 8GB. During a nightly batch process which syncs the backup data from an EBS volume of this instance to a S3 bucket, the swap memory is almost 100% utilised but the main memory still has abundant space in the range of 10-15 GB available.
Here's the swappiness default:
$ cat /proc/sys/vm/swappiness
60
Is it worrying? If yes, shall I add more swap space by having a larger swap file or opt for swap partitions instead?
16.04 server swap
New contributor
add a comment |
I've a AWS ec2 instance running Ubuntu 16.04 with 64 GB RAM and have a swap file configured for 8GB. During a nightly batch process which syncs the backup data from an EBS volume of this instance to a S3 bucket, the swap memory is almost 100% utilised but the main memory still has abundant space in the range of 10-15 GB available.
Here's the swappiness default:
$ cat /proc/sys/vm/swappiness
60
Is it worrying? If yes, shall I add more swap space by having a larger swap file or opt for swap partitions instead?
16.04 server swap
New contributor
add a comment |
I've a AWS ec2 instance running Ubuntu 16.04 with 64 GB RAM and have a swap file configured for 8GB. During a nightly batch process which syncs the backup data from an EBS volume of this instance to a S3 bucket, the swap memory is almost 100% utilised but the main memory still has abundant space in the range of 10-15 GB available.
Here's the swappiness default:
$ cat /proc/sys/vm/swappiness
60
Is it worrying? If yes, shall I add more swap space by having a larger swap file or opt for swap partitions instead?
16.04 server swap
New contributor
I've a AWS ec2 instance running Ubuntu 16.04 with 64 GB RAM and have a swap file configured for 8GB. During a nightly batch process which syncs the backup data from an EBS volume of this instance to a S3 bucket, the swap memory is almost 100% utilised but the main memory still has abundant space in the range of 10-15 GB available.
Here's the swappiness default:
$ cat /proc/sys/vm/swappiness
60
Is it worrying? If yes, shall I add more swap space by having a larger swap file or opt for swap partitions instead?
16.04 server swap
16.04 server swap
New contributor
New contributor
New contributor
asked yesterday
DebDeb
132
132
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.
This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.
add a comment |
This is not necessarily cause for concern and it doesn't indicate reducing or tweaking swappiness.
The answer by vandium is pretty comprehensive but I'd also like to mention a couple of things.
It can help to think of lower swappiness values as riskier, and higher values are more conservative. That is, lower swappiness values will wait until the memory situation is more dire and strained with little left for cache before it swaps while a higher swappiness will swap when the available memory and cache size is only slightly threatened. Many people think of reducing swappiness as a blanket way to reduce swapping but it's so often the case that you will still swap, but at a later time when your system is more desperate for memory. The real blanket solution to reduce swapping is adding more RAM.
Secondly, the behaviour for swapped data is for it to remain in swap until it's requested again, instead of being swapped out as soon as the memory demand decreases again. Some people see this and think it undesirable; they think swap should be avoided, but the justification for this is that the performance penalty for swapping out is around the same as swapping in, so the system avoids unnecessary swapping out. If you do end up needing something that's in swap, it's a swap out that would have happened anyway at some stage but by delaying it until it's requested it leaves the available memory and cache space nice and high (for good system performance, and for better response in case memory demand quickly goes back to its previous high again, such as if the high memory event was on a schedule) and avoids unnecessary I/O.
add a comment |
If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.
In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});
}
});
Deb is a new contributor. Be nice, and check out our Code of Conduct.
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%2faskubuntu.com%2fquestions%2f1123378%2fswap-full-but-memory-available-in-ram%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.
This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.
add a comment |
This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.
This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.
add a comment |
This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.
This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.
This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.
This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.
answered 21 hours ago
vanadiumvanadium
6,44111431
6,44111431
add a comment |
add a comment |
This is not necessarily cause for concern and it doesn't indicate reducing or tweaking swappiness.
The answer by vandium is pretty comprehensive but I'd also like to mention a couple of things.
It can help to think of lower swappiness values as riskier, and higher values are more conservative. That is, lower swappiness values will wait until the memory situation is more dire and strained with little left for cache before it swaps while a higher swappiness will swap when the available memory and cache size is only slightly threatened. Many people think of reducing swappiness as a blanket way to reduce swapping but it's so often the case that you will still swap, but at a later time when your system is more desperate for memory. The real blanket solution to reduce swapping is adding more RAM.
Secondly, the behaviour for swapped data is for it to remain in swap until it's requested again, instead of being swapped out as soon as the memory demand decreases again. Some people see this and think it undesirable; they think swap should be avoided, but the justification for this is that the performance penalty for swapping out is around the same as swapping in, so the system avoids unnecessary swapping out. If you do end up needing something that's in swap, it's a swap out that would have happened anyway at some stage but by delaying it until it's requested it leaves the available memory and cache space nice and high (for good system performance, and for better response in case memory demand quickly goes back to its previous high again, such as if the high memory event was on a schedule) and avoids unnecessary I/O.
add a comment |
This is not necessarily cause for concern and it doesn't indicate reducing or tweaking swappiness.
The answer by vandium is pretty comprehensive but I'd also like to mention a couple of things.
It can help to think of lower swappiness values as riskier, and higher values are more conservative. That is, lower swappiness values will wait until the memory situation is more dire and strained with little left for cache before it swaps while a higher swappiness will swap when the available memory and cache size is only slightly threatened. Many people think of reducing swappiness as a blanket way to reduce swapping but it's so often the case that you will still swap, but at a later time when your system is more desperate for memory. The real blanket solution to reduce swapping is adding more RAM.
Secondly, the behaviour for swapped data is for it to remain in swap until it's requested again, instead of being swapped out as soon as the memory demand decreases again. Some people see this and think it undesirable; they think swap should be avoided, but the justification for this is that the performance penalty for swapping out is around the same as swapping in, so the system avoids unnecessary swapping out. If you do end up needing something that's in swap, it's a swap out that would have happened anyway at some stage but by delaying it until it's requested it leaves the available memory and cache space nice and high (for good system performance, and for better response in case memory demand quickly goes back to its previous high again, such as if the high memory event was on a schedule) and avoids unnecessary I/O.
add a comment |
This is not necessarily cause for concern and it doesn't indicate reducing or tweaking swappiness.
The answer by vandium is pretty comprehensive but I'd also like to mention a couple of things.
It can help to think of lower swappiness values as riskier, and higher values are more conservative. That is, lower swappiness values will wait until the memory situation is more dire and strained with little left for cache before it swaps while a higher swappiness will swap when the available memory and cache size is only slightly threatened. Many people think of reducing swappiness as a blanket way to reduce swapping but it's so often the case that you will still swap, but at a later time when your system is more desperate for memory. The real blanket solution to reduce swapping is adding more RAM.
Secondly, the behaviour for swapped data is for it to remain in swap until it's requested again, instead of being swapped out as soon as the memory demand decreases again. Some people see this and think it undesirable; they think swap should be avoided, but the justification for this is that the performance penalty for swapping out is around the same as swapping in, so the system avoids unnecessary swapping out. If you do end up needing something that's in swap, it's a swap out that would have happened anyway at some stage but by delaying it until it's requested it leaves the available memory and cache space nice and high (for good system performance, and for better response in case memory demand quickly goes back to its previous high again, such as if the high memory event was on a schedule) and avoids unnecessary I/O.
This is not necessarily cause for concern and it doesn't indicate reducing or tweaking swappiness.
The answer by vandium is pretty comprehensive but I'd also like to mention a couple of things.
It can help to think of lower swappiness values as riskier, and higher values are more conservative. That is, lower swappiness values will wait until the memory situation is more dire and strained with little left for cache before it swaps while a higher swappiness will swap when the available memory and cache size is only slightly threatened. Many people think of reducing swappiness as a blanket way to reduce swapping but it's so often the case that you will still swap, but at a later time when your system is more desperate for memory. The real blanket solution to reduce swapping is adding more RAM.
Secondly, the behaviour for swapped data is for it to remain in swap until it's requested again, instead of being swapped out as soon as the memory demand decreases again. Some people see this and think it undesirable; they think swap should be avoided, but the justification for this is that the performance penalty for swapping out is around the same as swapping in, so the system avoids unnecessary swapping out. If you do end up needing something that's in swap, it's a swap out that would have happened anyway at some stage but by delaying it until it's requested it leaves the available memory and cache space nice and high (for good system performance, and for better response in case memory demand quickly goes back to its previous high again, such as if the high memory event was on a schedule) and avoids unnecessary I/O.
answered 20 hours ago
thomasrutterthomasrutter
27.1k46689
27.1k46689
add a comment |
add a comment |
If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.
In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.
add a comment |
If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.
In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.
add a comment |
If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.
In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.
If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.
In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.
answered 21 hours ago
Erik LamersErik Lamers
671
671
add a comment |
add a comment |
Deb is a new contributor. Be nice, and check out our Code of Conduct.
Deb is a new contributor. Be nice, and check out our Code of Conduct.
Deb is a new contributor. Be nice, and check out our Code of Conduct.
Deb is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1123378%2fswap-full-but-memory-available-in-ram%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