Re: swap-file vs. swap-partition

From: Enrico Weigelt (weigelt@nibiru.pauls.erfurt.thur.de)
Date: Fri Jun 23 2000 - 22:25:17 EST


Gryn wrote:
hi,
>
> Most new filesystems will have a maximum contiguous size that is possible for
> a file. For ext2, I believe it is around 4 meg. Beyond that, you would be
> interfering with the rest of the filesystems basic structure. I think it
> would be easier to just use a partition if you are very concerned with speed.
hmm... something like a fragment list would help here...

        id dev start size
        1 3:1 4096 4096
        2 3:1 12288 4096
        ...

>
> What I personally do is give myself a very small swap partition, generally no
> larger than 64 meg, but sometimes smaller if the drive is small. I then will
> make swap files later on if I need too. I also assign the swap files a lower
> priority than the swap partition, so that it is generally used less.
well, i don't like extra swap partitions, since you cannot resize it
without much trouble.

> The other thing I will do is try to make several small partitions on multiple IDE
> drives, if I am on such a system. This helps out alot as the kernel will
> access them more or less in parallel if they all have the same priority.
yeah, that makes sense.

> But again, there are very few situations where you need large amounts of swap,
> because, as you said, it would generally just act as a bottle neck so you can
> say "Opps!" and have time to kill the process off before it runs away with all
> of the memory and causes the rest of the programs to bomb. :)
but you can also use process accounting ... maybe processes which need
too much
memory are delayed a while.
 
> The only time that I can think of where large amounts of swap would help out,
> would be when you have a large number of processes (or tasks) that must be
> held available in memory, but probably won't be used for long periods of time.
> (such as a directory server that keeps both searchable and non searchable (but
> accessable) information -- the searchable stuff needs to stay in real memory,
> but you need fast access to the non searchable stuff when an individual record
> is pulled up).
correct. AND: i don't want to calculate, how much swap i'll ever need
before installing my system. that really sucks.
(i also started to write a swap deamon, which resizes the swap
automatically...)

> However, most services do -not- work like that. And user systems generally
> do not have many programs that sleep long enough to get swapped out (not more
> than 7 or 8 megs worth). All of my memory ends up going to harddrive cache.
> (even my 64 meg systems that do proxying and xwindows).
>
> Anyway, swap is useful in many cases, it's just that I always see way to much
> of it allocated on peoples systems. (Who needs a gig of swap space???)
                                        ^^^^^^^^^^^^^^^^^^^
well, there are some situations (i.e. graphics manipulation, ....)
my aim is that no application has to invent its own swap system - even
it needs some hundred megs of ram...

bye,
ew.

>
> -Adam
>
> p.s. One interesting thing I saw was a patch for a swap file over an NFS
> mount -- I used it to have a completely diskless system. Well, except for the
> Kernel image, which I put on a floppy disk since I didn't have a eprom writer
> for my network card.
i also had such a thing - but i booted via Netware BootROM on the NIC.

It ran nicely over a 100mbs network. I kept a small (1
<snip>

--------------------------------------
Killing nature killing animals,
dont disturb we love our chemicals

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:07 EST