LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-31-2018, 07:27 AM   #1
spcrocket
LQ Newbie
 
Registered: Dec 2018
Posts: 2

Rep: Reputation: Disabled
Question Swap file size question platter hd vs ssd


I have 2 hard drives and 3 solutions for 1 computer.

1 - use just the hdd.
2 - use just the ssd.
3 - use both.

RAM = 48GB

For each of those solutions what would be the best swap file size and for solution 3 which drive should the swap file go to.

After some searching, I found out that 2GB more than ram is normal, so I figured for all solutions to have a 50GB swap file. Again for solution 3 what drive would I put that on.

Or is there a more sensible solution for this. I am using Debian 9.
 
Old 12-31-2018, 11:43 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Swap size really depends on what applications you are running, how you use the computer and if you hibernate. Ubuntu seems to recommend the most swap space with rough numbers being 8GB for no hibernation and 56GB with hibernation for 48GB RAM.

Some would say that you should put swap on the HDD to prevent wearing out the SDD and some say it does not matter. Considering that you may not use swap at all I say it does not matter.
 
Old 12-31-2018, 01:43 PM   #3
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by michaelk View Post
Some would say that you should put swap on the HDD to prevent wearing out the SDD and some say it does not matter. Considering that you may not use swap at all I say it does not matter.
If you use hibernation (and a lot of laptop users do), I would say: put the swap on the hard disk. It mostly is larger then the SSD and speed for swap doesn't matter that much.
Keep the SSD for things that need the speed.
 
Old 12-31-2018, 04:17 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by ehartman View Post
... and speed for swap doesn't matter that much.
Really ?. Swapin speed usually matters a lot - this is by definition where a user is waiting for the I/O completiton. Very few user seem to have any patience.

Swap is easy to resize and move - I would pick a number, say 10 Gig, stick it on the hard disk, and see what happens. Proceed based on actual data rather than speculation.
 
Old 12-31-2018, 11:51 PM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by syg00 View Post
Really ?. Swapin speed usually matters a lot - this is by definition where a user is waiting for the I/O completiton.
Yeah but most modern systems have RAM enough that swapping doesn't occur much.
Swap is often only there to get rid of startup and other inactive daemons (AND for hibernation, of course). Try the "free" command to see how much swap you're currently using.
Mine, about a month since the last reboot is
Code:
Swap:      4198580      23932    4174648
so less then 24 MB used out of 4 GB available.
 
Old 01-01-2019, 01:46 AM   #6
Howard1975
LQ Newbie
 
Registered: Aug 2017
Location: Delavan, Wisconsin, USA
Distribution: Slackware, MX Linux, Devuan, Debian, Puppy, Linux Lite, Linux Mint, etc.
Posts: 16

Rep: Reputation: Disabled
Swap size (and location) really depends on your particular computer habits and needs. It depends on if this is a laptop or a desktop, and if you ever hibernate or not. And depends on how you use the computer.

I have a desktop computer with 32 GB of RAM, with 6 GB of swap space, and it almost never uses the swap space. Once in a rare moment, it will use some swap space, when I'm compiling software.

My laptop only has 4 GB of RAM memory, with around 5 to 6 GB swap space, and it will sometimes use the swap space, when I have too many tabs open in Firefox or Chrome(ium). Or I'm compiling software on it.

I don't have any SSD drives, other then a tiny 32 GB SSD inside a netbook. That netbook has 1 GB of RAM memory, not much at all. All my other drives are the traditional spinning hard drives. But if I had a SSD and hard drive combination, I personally would put the swap space on the hard drive. To conserve the amount of writes to the SSD, assuming the computer actually used the swap.

I fully realize a SSD is much faster compared to a traditional spinning hard drive, but they cannot handle as many writes to a particular sector.

Howard

Last edited by Howard1975; 01-01-2019 at 01:49 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSD and 8GB RAM, What size SWAP? wulp Linux - General 9 08-25-2011 10:38 AM
[SOLVED] Should I move my Swap Partition from my SSD to the platter? skipf Linux - Hardware 2 12-05-2010 11:50 AM
Home Server On A Silver Platter - almost tdewire Linux - Newbie 1 11-26-2009 09:51 AM
Which partition is closest to the edge of my disk's platter? WeNdeL Linux - Hardware 4 10-22-2003 06:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration