Will multiple swap space's be effective?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
I installed Ubuntu on a 130 ssd and by default it only allocated one GB of swap space. I know swap space should be at least the size of your RAM so I would like to increase it. Instead of resizing I would like to make a new partition on my 1tb drive. I am wondering if this will hurt the performance of the swap space a lot or just a little because the additional space is on a hard drive and not SSD. Or if having multiple locations is a bad idea.
partitioning swap
add a comment |Â
up vote
0
down vote
favorite
I installed Ubuntu on a 130 ssd and by default it only allocated one GB of swap space. I know swap space should be at least the size of your RAM so I would like to increase it. Instead of resizing I would like to make a new partition on my 1tb drive. I am wondering if this will hurt the performance of the swap space a lot or just a little because the additional space is on a hard drive and not SSD. Or if having multiple locations is a bad idea.
partitioning swap
how much memory do you have?
â rtaft
May 26 at 14:42
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I installed Ubuntu on a 130 ssd and by default it only allocated one GB of swap space. I know swap space should be at least the size of your RAM so I would like to increase it. Instead of resizing I would like to make a new partition on my 1tb drive. I am wondering if this will hurt the performance of the swap space a lot or just a little because the additional space is on a hard drive and not SSD. Or if having multiple locations is a bad idea.
partitioning swap
I installed Ubuntu on a 130 ssd and by default it only allocated one GB of swap space. I know swap space should be at least the size of your RAM so I would like to increase it. Instead of resizing I would like to make a new partition on my 1tb drive. I am wondering if this will hurt the performance of the swap space a lot or just a little because the additional space is on a hard drive and not SSD. Or if having multiple locations is a bad idea.
partitioning swap
asked May 26 at 14:10
Stephen
62
62
how much memory do you have?
â rtaft
May 26 at 14:42
add a comment |Â
how much memory do you have?
â rtaft
May 26 at 14:42
how much memory do you have?
â rtaft
May 26 at 14:42
how much memory do you have?
â rtaft
May 26 at 14:42
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
In general this highly depends on your use case. E.g. if you do not make use of hibernate to disk (which uses swap to hibernate) you do not need that much amount of swap space and 1GB might be sufficient.
To come back to your question. If you are swapping a lot e.g. because you run low on memory all the time and you have one swap partition on a SSD and the other on a HDD, this will impact performance as the HDD will be the bottleneck in this scenario.
If you just want to add some more swap space for some corner cases to prevent the out-of-memory killer, you could add the swap space on your SSD with a higher priority compared to the swap partition on your HDD. That would result in that the swap on the SSD would get filled first, when the swap area on the SSD is exhausted the swap space on the HDD would be used additionally.
From man 2 swapon
.
Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.
To change the default priority of your swap partitions you would have to add/alter your /etc/fstab
.
/dev/<swap-ssd> swap swap defaults,prio=1000 0 0
/dev/<swap-hdd> swap swap defaults 0 0
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
In general this highly depends on your use case. E.g. if you do not make use of hibernate to disk (which uses swap to hibernate) you do not need that much amount of swap space and 1GB might be sufficient.
To come back to your question. If you are swapping a lot e.g. because you run low on memory all the time and you have one swap partition on a SSD and the other on a HDD, this will impact performance as the HDD will be the bottleneck in this scenario.
If you just want to add some more swap space for some corner cases to prevent the out-of-memory killer, you could add the swap space on your SSD with a higher priority compared to the swap partition on your HDD. That would result in that the swap on the SSD would get filled first, when the swap area on the SSD is exhausted the swap space on the HDD would be used additionally.
From man 2 swapon
.
Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.
To change the default priority of your swap partitions you would have to add/alter your /etc/fstab
.
/dev/<swap-ssd> swap swap defaults,prio=1000 0 0
/dev/<swap-hdd> swap swap defaults 0 0
add a comment |Â
up vote
0
down vote
In general this highly depends on your use case. E.g. if you do not make use of hibernate to disk (which uses swap to hibernate) you do not need that much amount of swap space and 1GB might be sufficient.
To come back to your question. If you are swapping a lot e.g. because you run low on memory all the time and you have one swap partition on a SSD and the other on a HDD, this will impact performance as the HDD will be the bottleneck in this scenario.
If you just want to add some more swap space for some corner cases to prevent the out-of-memory killer, you could add the swap space on your SSD with a higher priority compared to the swap partition on your HDD. That would result in that the swap on the SSD would get filled first, when the swap area on the SSD is exhausted the swap space on the HDD would be used additionally.
From man 2 swapon
.
Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.
To change the default priority of your swap partitions you would have to add/alter your /etc/fstab
.
/dev/<swap-ssd> swap swap defaults,prio=1000 0 0
/dev/<swap-hdd> swap swap defaults 0 0
add a comment |Â
up vote
0
down vote
up vote
0
down vote
In general this highly depends on your use case. E.g. if you do not make use of hibernate to disk (which uses swap to hibernate) you do not need that much amount of swap space and 1GB might be sufficient.
To come back to your question. If you are swapping a lot e.g. because you run low on memory all the time and you have one swap partition on a SSD and the other on a HDD, this will impact performance as the HDD will be the bottleneck in this scenario.
If you just want to add some more swap space for some corner cases to prevent the out-of-memory killer, you could add the swap space on your SSD with a higher priority compared to the swap partition on your HDD. That would result in that the swap on the SSD would get filled first, when the swap area on the SSD is exhausted the swap space on the HDD would be used additionally.
From man 2 swapon
.
Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.
To change the default priority of your swap partitions you would have to add/alter your /etc/fstab
.
/dev/<swap-ssd> swap swap defaults,prio=1000 0 0
/dev/<swap-hdd> swap swap defaults 0 0
In general this highly depends on your use case. E.g. if you do not make use of hibernate to disk (which uses swap to hibernate) you do not need that much amount of swap space and 1GB might be sufficient.
To come back to your question. If you are swapping a lot e.g. because you run low on memory all the time and you have one swap partition on a SSD and the other on a HDD, this will impact performance as the HDD will be the bottleneck in this scenario.
If you just want to add some more swap space for some corner cases to prevent the out-of-memory killer, you could add the swap space on your SSD with a higher priority compared to the swap partition on your HDD. That would result in that the swap on the SSD would get filled first, when the swap area on the SSD is exhausted the swap space on the HDD would be used additionally.
From man 2 swapon
.
Swap pages are allocated from areas in priority order, highest priority first. For areas with different priorities, a higher-priority area is exhausted before using a lower-priority area. If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.
To change the default priority of your swap partitions you would have to add/alter your /etc/fstab
.
/dev/<swap-ssd> swap swap defaults,prio=1000 0 0
/dev/<swap-hdd> swap swap defaults 0 0
answered May 26 at 14:37
Thomas
3,10071325
3,10071325
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1040611%2fwill-multiple-swap-spaces-be-effective%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
how much memory do you have?
â rtaft
May 26 at 14:42