lkml.org 
[lkml]   [2006]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Slow swapon for big (12GB) swap
Grzegorz Kulewski wrote:

> Hi,
>
> I am using big swap here (as a backing for potentially huge tmpfs).
> And I wonder why swapon on such big (like 12GB) swap takes about 7
> minutes (continuous disk IO). Is this expected? Why it is like that?
> Can I do anything to speed it up? Or maybe remove it into the
> background with low priority or something like that?

I don't know why it is slow. But you can certainly do something like:

nice swapon /dev/yourdisk &

Then it will happen in the background and with low priority. Of course,
you can't start filling your tmpfs until this completes.


I don't think tmpfs+swap was made with this sort of use in mind,
so you may want to test the performance when you fill up such a
tmpfs, and compare to the performance of /tmp on a 12GB
ordinary filesystem. It seems to me that the advantage of /tmp on
tmpfs is lost completely if most of it has to be written to disk anyway.
(Ordinary filesystems are cached too, the "tmpfs advantage" is that
truly temporary (but possibly long-lived) files are never written
to disk _if_ you have enough memory. /tmp on a plain filesystem
is just as fast due to caching, but may delay other use of the
disk as the ordinary filesystem writes stuff out so it will be
saved for the future.)

If you go for a plain filesystem, consider ext2 which is simple faster
than journalling systems like ext3. You don't need the added
safety for temporary stuff. Now ext2 have long fsck times if
something goes wrong, but you don't need to fsck this filesystem.
Have your bootscripts run mke2fs at boot instead of fsck for
this filesystem. mke2fs on 12GB is fast, much faster than
7 minutes. Expect a few seconds only.

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

\
 
 \ /
  Last update: 2006-04-10 09:38    [from the cache]
©2003-2011 Jasper Spaans