Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reliable swap and where to put it?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1710
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 23, 2020 12:11 pm    Post subject: Reliable swap and where to put it? Reply with quote

I'd like to add swap space for my server. The said server runs, in among other things, virtual machines which I manage remotely via virt-manager. Most of the are in paused state. When paused kernel tends to move the memory pages of those virtual machine processes into swap, which is good. The problem is that I have only zram for swap. I'd like to have a real hardware swap as an lower priority swap space there too.
After reading this, I think raid5-6'ing swap isn't that bad idea after all.

The best solution is almost always to increase RAM, which I intend to do. I think my server can take 64GB max DDR3. But at the moment I have only 16GB. Unfortunately my server is built from consumer parts and the motherboard cannot use ECC RAM.

Since my server boots (/boot and /boot/efi on a usb stick) from a five disk raw (no partition table) btrfs array, I don't have any space for swap there. I've looked at wan (write acceleration module) cards to use as a fast swap too, but those are way too expensive considering how little space (RAM really) they give.

Now I ask what's the best place (reliable) to put swap? And does raid5-6'ing do any good in terms of error correction?
I've used raid5'd swap on my desktop earlier to have faster wake up from hibernation (since linux does not support de-hibernation from multiple swap files/partitions), but that's another story.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6351

PostPosted: Mon Mar 23, 2020 8:53 pm    Post subject: Reply with quote

I don't know if the raid will complicate things, but you can put swap files on btrfs now via some contrivance:
Code:
touch swap.bin
chattr +C swap.bin
chmod 600 swap.bin
fallocate --length 2G swap.bin
mkswap swap.bin
swapon swap.bin
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1710
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 23, 2020 9:45 pm    Post subject: Reply with quote

Oh boy. That is great news!

I'll try it out. Thanks!
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1710
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 23, 2020 10:07 pm    Post subject: Reply with quote

Dang it!
I guess 4.19.86 kernel is not new enough. :(
I'm getting "swapon failed: Invalid argument".

I'm not very keen to upgrade kernel on my server. I'm waiting for 5.6 to arrive (and get amd64 keyworded) as it should be the next LTS kernel.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44945
Location: 56N 3W

PostPosted: Mon Mar 23, 2020 10:07 pm    Post subject: Reply with quote

Zucca,

Is using suspend an option?
The machine state is saved to a file, rather like hibernate.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1710
Location: KUUSANKOSKI, Finland

PostPosted: Mon Mar 23, 2020 10:14 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Zucca,

Is using suspend an option?
The machine state is saved to a file, rather like hibernate.
Wasn't that the other way around?

Anyway. I don't follow where suspend or hibernate comes in here...

Hibernating my server when power is cut and UPS batteries are starting to drain out would be a nice option, but That's not "in the menu" for any time soon. :)

EDIT: Ah yes. Of course suspending VMs is possible. I just tend to pause them for faster access.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum