What is the ideal SWAP dimension for 2TB-3TB-3TB-6TB-8TB disks?

246 views
Skip to first unread message

Gabriele Desinano

unread,
Feb 3, 2021, 1:07:26 PM2/3/21
to Alt-F

Hi all,
I'm asking this because after a long search I found very few answers to similar question.

 I understood that for a 2TB disk,  512MB of swap file is enought. I'm sure that it depends also about the NAS model or better about the initial RAM for every NAS model.

Until now I succesfully had 512MB of swap file for 3GB HDD, I have more NAS and every NAS is dedicated to some services: this just to have the possibility to switch off some  services granting others.

 So I've:
- one dedicated to multimedia sharing
- one for P2P
- one just to have common working space and for cloud
- one is just for BACKUP and I turn on it just to back up what I want, when I want.
- one for spare e tests
 I choosed not to have RAID systems and  I brough used NAS to do this: I start in the past with used DNS323 and step by step I converted them into DNS325.
I installed one disk only for every NAS and the second bay is just for CLONING or temporay use with testing disks. All my NAS boot from dedicated 8GB nano USB key (that is simple to excange for any reason,  and for working on). I've also a low priority swap partition on the USB keys in case to be used just for help the primary swap onto HDD.

Today are arrived  2 new 6TB disks because My multimedia ones and the  and CLOUD ones were next to be full.

 Now, what is the TOTAL size for the swap partitions for those 6TB disks?

DISKS          HGH PRIORIY SWAP      LOW PRIORITY SWAP    TOTAL SWAP
1 x 2TB   ->                  0.512 GB                                  0 GB                 0.512 GB
1 x 3TB   ->                  0.512 GB              +          0.512 GB                         1 GB  
1 x 4TB   ->                           1GB ?           +                  1 GB ?                      2 GB
1 x 6TB   ->                           1GB ?           +                  1 GB ?                      2 GB
1 x 8TB   ->                           2GB ?           +                  2 GB ?                      4 GB


Tom Schmidt

unread,
Feb 3, 2021, 7:40:25 PM2/3/21
to al...@googlegroups.com
I have 0.5GB swap on each of my 6TB drives in my DNS-327L, giving 1GB total.  Note the DNS-327L has 512MB of RAM, whereas the DNS-323 has only 64MB.  The main time swap is critical to have is when running a fsck on the RAID data partitions.  I also have a DNS-323 with 2 x 2TB drives and also have 0.5GB swap on each.

Here is my partition table (same on both disks):

Partition left disk, 6.0TB, HGST HDN726060ALE610

Using GPT partitioning.

Every internal disk must have a swap partition as its first partition, 0.5GB per 2TB disk is generally enough.

KeepDevStart sectorLengthSize (GB)Type
sda1
sda2
sda3
sda4
Free:



--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alt-f/ed0c45ec-c715-49ee-97ca-6af799552830n%40googlegroups.com.

Gabriele Desinano

unread,
Feb 4, 2021, 4:31:59 AM2/4/21
to Alt-F
 Thanks, the question born in my mind reading posts writing about lack of swap causing impossibility to end the hdd checks. I had to decide and couldn't wait for any help so I partitioned 2GB swap partition...
Just at this moment is running the 6TB disk check and it's using 17% of the swap space that is 2GB (for the 6TB HDD), 512MB (for the old 3TB HDD) and 512MB (for low priority USB KEY SWAP). The swap use growed at the 5th checking step up tu 17% of the swap space, so finally they were used a max of 492MB of swap space of 3072MB.
 The RAM used was 98% of 256MB. So now it seems to me that 512 MB of SWAP SPACE is correct also for 6TB HDD, may be too correct :) :) :)
For the 3TB HDD they where used max 9% SWAP SPACE of 3072MB that are about 280MB.

Reading those informations I think that 512MB of total SWAP SPACE is correct for a 3TB HDD but for a 6TB HDD it could be better to have almost 1GB of SWAP SPACE TOTAL

3TB HDD -> 280MB max used  at 5th check step -> 512MB minimal suggested
6TB HDD -> 490MB max used  at 5th check step ->  1GB minimal suggested

 Please, who has something to say about it, write here, I think it could be helpfull for all.

thanks in advance

João Cardoso

unread,
Feb 4, 2021, 12:47:32 PM2/4/21
to Alt-F
On Thursday, February 4, 2021 at 9:31:59 AM UTC Gabriele Desinano wrote:
 Thanks, the question born in my mind reading posts writing about lack of swap causing impossibility to end the hdd checks. I had to decide and couldn't wait for any help so I partitioned 2GB swap partition...
Just at this moment is running the 6TB disk check and it's using 17% of the swap space that is 2GB (for the 6TB HDD), 512MB (for the old 3TB HDD) and 512MB (for low priority USB KEY SWAP). The swap use growed at the 5th checking step up tu 17% of the swap space, so finally they were used a max of 492MB of swap space of 3072MB.
 The RAM used was 98% of 256MB. So now it seems to me that 512 MB of SWAP SPACE is correct also for 6TB HDD, may be too correct :) :) :)
For the 3TB HDD they where used max 9% SWAP SPACE of 3072MB that are about 280MB.

Reading those informations I think that 512MB of total SWAP SPACE is correct for a 3TB HDD but for a 6TB HDD it could be better to have almost 1GB of SWAP SPACE TOTAL

3TB HDD -> 280MB max used  at 5th check step -> 512MB minimal suggested
6TB HDD -> 490MB max used  at 5th check step ->  1GB minimal suggested

 Please, who has something to say about it, write here, I think it could be helpfull for all.

The fsck memory requirements are different if you have one folder with one million files on it or have those same files distributed by a thousand folders. It depends on how you organize your data on folders and subfolders, with a wider and shallow folder/subfolder structure or a narrower and deeper folder/subfolder organization, and the number of files per folder. Its also depends on your typical file size, having a milion 1MB files is different from having a thousand 1GB files.
So, what works for you might not work for others, there are no recipes.

For programs other than fsck, which you can't dispense (D-Link fw did!), the rule is that if swap in being actively used, you should add more memory. As you can't do that on the boxes, you have to change your usage pattern, limiting the number of programs in execution or users using those programs, or restricting the programs resources using the programs configuration. Again, no recipes.

Gabriele Desinano

unread,
Feb 5, 2021, 5:11:59 AM2/5/21
to Alt-F
Wow joao Cardoso! (thanks for the super ALT-F)
 That's ok: there aren't informations about swap dimensions because there aren't recipes. Anyway I had to decide and because it's shouldn't be easy modify partitions after  having filled the data partitions, I choosed 2GB swap partition that could be a minimal wast of space in front of a 6TB HDD.

João Cardoso

unread,
Feb 5, 2021, 11:49:04 AM2/5/21
to Alt-F
On Friday, February 5, 2021 at 10:11:59 AM UTC Gabriele Desinano wrote:
Wow joao Cardoso! (thanks for the super ALT-F)
 That's ok: there aren't informations about swap dimensions because there aren't recipes.

When I started with unix a few tens years ago, the "recipe"/myth what to use swap 2.5x the amount of RAM. Not 2x or 3x, it had to be 2.5x.
Like crocs living in the sewers,  a myth (except in Florida, where there are indeed crocs in the sewers, according to National Geographic :-O)
Reply all
Reply to author
Forward
0 new messages