[mdlug] Question about swap spaces

email5000 at usa.com email5000 at usa.com
Tue May 12 07:58:18 EDT 2020


Thanks for your replies, everyone....

I think there is an assumption about how NAS's are constructed. Although
I'm not intimately familiar with NAS construction, I suspect that
today's boxes have enough processing power and significantly more memory
than those of, say, a decade ago - with all the kinds of
functionality/services. Nevertheless, for all that functionality, there
MUST BE some sort of OS, which implies a processor and some s/w for the
services. And I believe this functionality is provided in/by the ROM/RAM
space - separate from the physical storage space (i.e. the HDD's), so
that would preclude the need for swap space on the HDD's themselves.

I bought my 2-bay NAS 11 years ago, and was considered EOL in 2010. It
is a low-end model. It has a 'primitive' 8MB of flashrom & 2x32 MB of
ram (YES, both are Megabytes!), up to SATA 2, USB 2 ('originally'
intended for a printer). It came with such configuration for users/group
classification, and services as a UPnP server, iTunes server, DHCP
server, RAID capability (configurations for 'Standard', JBOD, RAID0,
RAID1) for 2 discs.

Nevertheless, my needs were very simple and basic: essentially a thumb
drive that sits on the network with enough space for my data-storage
requirements; and accessible to all my network machines. I didn't really
need an 'OS' as such (except for the serving of the data). It has served
me well over these past years.

However, there is a fan-following for this product, and one of those
fans decided to write new firmware OS (fw), using a Linux kernel, and
supports RAID 0/1/5 (5 using the USB port for a memory stick); and up to
8TB drives (the original fw supported up to 2TB drives). I can't
possibly know the memory mapping, nor firmware layout of the OS fw; but
from what I've read, the firmware is divided into the 'upper' and
'lower'; one is for the OS as such (I think), and the other is for
configuration settings. The author wrote the OS part and left [at least
some of] the settings alone - for flashing this new fw and for other
particular settings that could/should be left for the end user. This fw
has received 5/5 stars from all who rated it (except for 1 who didn't do
his homework and didn't follow the directions: he lost all his data !! -
too bad).  This fw is still [at least somewhat] actively supported. 
Since I'm cheap, and I have difficulty throwing away something that
still has useful value, I decided to try this fw, if only as an
experiment - I figured I may actually need to buy another box if it
didn't work (or if I 'bricked' the box). My primary goals were to
provide for at least SMB2 and above (the OE fw only SMB1, which is
deprecated by ALL OS's today.), and a realistic implementation of DST.
Oddly, the OE fw wanted a specific DATE for the DST switchover. I don't
think there's a country in world which uses DST that is not switched
over by a specific WEEKEND, not a date. This new fw provides those two
requirements. This fw also provides for rsync, ftp, sftp, ssh, lpd,
DNS/DHCP, web/UPnP/mail servers, (PHP/MySQL packages available for
installation for web support). I think that in order to provide the
services - considering that the ROM/RAM-spaces are so small - that the
author decided to provide a specific folder on one of the physical
drives for the s/w for this functionality, which it creates when
installed - installation drive placement determined by end-user. So far,
all has gone well. I've been using the original JBOD configuration; but
I'm running out of space - 2 drives: 500/1500 GB. So I bought 4 TB
drives, thinking RAID 1. I'm also thinking of experimenting with the
various servers, so I'm trying to plan ahead as to partitions needed.
That's why the questions about swap space - planning ahead.

So, considering the 'surprise' about needing a swap partition, I'M
assuming that the comments are based on assumptions about NAS's based on
what is currently available. I don't see any disagreement between my
understanding of it all and with any of the comments, as far as why/when
swap spaces are needed - I think we're in agreement. The space is just
not available within the confines of the internal ROM/RAM on my NAS. So,
I think I actually do need a swap partition. As for having multiple swap
partitions, I was thinking about 'corruption' of data between the
services (or any of the 'goings-on', however you want to say it),
especially with the scenario I mentioned: If your mm server is generally
accessible on the web, but your workspace (on a separate partition) is
data-sensitive (and obviously would NOT be available anywhere outside
its own realm), then you wouldn't want any 'cross-contamination'. I know
this may seem so very unlikely - but hey, hiccups happen !! But then, if
the workspace area were so data-sensitive, then you should probably be
using a completely different NAS - not the one with a publicly available
server !!

Thanks again to all who responded !!

-Rich

On 5/10/2020 19:39, David L Lambert wrote:
> I agree. Swap space is per CPU, in other words per kernel instance,
> and there's no partitioning or subdividing swap-space.
>
> It might make sense to put swap-space on a NAS where local disk is
> slow and NAS is fast, or to temporarily run a process that allocates
> huge memory but uses it lightly. Or the NAS supervisor itself might
> use swap, but that's probably bad for both performance and reliability.
>
> -----Original Message-----
> From: mdlug-bounces at mdlug.org [mailto:mdlug-bounces at mdlug.org] On
> Behalf Of Carl T. Miller
> Sent: Sunday, May 10, 2020 7:08 PM
> To: mdlug at mdlug.org
> Subject: Re: [mdlug] Question about swap spaces
>
> I can't think of any reason to have swap space on a NAS. Swap space is
> used by the OS, and it is not associated with data partitions.
> (Granted, swap space can be on a partition, but it isn't used by any
> partition.) So...if you need swap space, that should be on a device on
> the computer.
>
> Since you already have several partitions on the NAS and you plan to
> provide access to each as needed, is there anything else you need?
>
> c
>
>
> On 5/10/20 5:17 PM, email5000 at usa.com wrote:
>> Is there any reason you would want multiple swap spaces on a [NAS]
>> data drive?
>>
>> Suppose you have a partition for 'workspace' plus just general data.
>> You have another partition for multimedia (mm), which you want to be
>> able to stream. You could even extend the scenario to include a third
>> partition for a website. You want them all separate due to
>> accessibility issues (you don't want your family accessing your
>> data/workspace, but mm OK for some, while website accessibility is OK
>> for others. Would you want (or even NEED) a separate swap space for
>> each of those 2-3 'primary-purpose'
>> partitions?
>>
>> Thoughts?.....
>>
>> Thx,
>> -Rich.
>>
> On 5/10/2020 17:59, Josh Catana wrote:
>> Swap has more to do with RAM than partitioning. It's used by the kernel to
>> offload unused memory pages to disk to free up RAM. Ideally you'd put it on
>> the fastest storage in your system. More than one pool is a waste and there
>> isn't any inherent benefit. The only reason I could see to add a second
>> swap partition is if your system memory is swapping SO much that your
>> current swap partition is full and you need to add more but you cannot
>> resize your current partition. Nowadays most sane people just get more RAM.
>>
>>
>> Some argue that with the huge amounts of RAM available in today's systems
>> swap isn't even necessary, but running that way is risky unless you really
>> know what you're doing.
>>
>> On Sun, May 10, 2020, 5:17 PM <email5000 at usa.com> wrote:
>>
>>> Is there any reason you would want multiple swap spaces on a [NAS] data
>>> drive?
>>>
>>> Suppose you have a partition for 'workspace' plus just general data. You
>>> have another partition for multimedia (mm), which you want to be able to
>>> stream. You could even extend the scenario to include a third partition
>>> for a website. You want them all separate due to accessibility issues
>>> (you don't want your family accessing your data/workspace, but mm OK for
>>> some, while website accessibility is OK for others. Would you want (or
>>> even NEED) a separate swap space for each of those 2-3 'primary-purpose'
>>> partitions?
>>>
>>> Thoughts?.....
>>>
>>> Thx,
>>> -Rich.
>>>
>>>
>>> _______________________________________________
>>> mdlug mailing list
>>> mdlug at mdlug.org
>>> http://mdlug.org/mailman/listinfo/mdlug
>>>
>> _______________________________________________
>> mdlug mailing list
>> mdlug at mdlug.org
>> http://mdlug.org/mailman/listinfo/mdlug


More information about the mdlug mailing list