[Gllug] performance difference between a swap partition vs a swap file.>>>>>

James Hawtin oolon at ankh.org
Wed Dec 2 10:39:23 UTC 2009

33GB swap partition sounds insane, perhaps you have a very large amount of
memory if that was the case you would want good performance, which 33GB of a
single disk subsystem would not give you. Perhaps you have a very large
tmpfs filesystem, in which case more swap would make sence otherwise.

I setup all systems except Solid state drive ones which get NO swap.

1-2GB of swap. /tmp using tmpfs 1GB is size which then claws back the
waste. Its nice to have a little swap, as it might be necessary to allocate
as much memory as the size of an existing process when it forks. This can
come from swap rather than real memory.  But really using it should be avoided.

As to File or Partition, Partition should be faster so long as its comming from
the same disk subsystem, a filesystem over many devices might be
faster. However so would many small swap partions on lots of devices, either
way its VERY slow compared to memory. A filesystem as an overhead to it,
partitulary a reference counting one, this is going to make it slower for
swap than a native partition. In the old days a filesystem partition might
make space as you can change it, these days with LVM its easy to change the
size of partitions later. 

Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list