[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

swap and /tmp



I am thinking of using a tmpfs for /tmp, and would be interested
to hear any thoughts that others have on this issue.

Obviously it would mean that /tmp would be volatile, which sames
having to clean it up, but is sometimes annoying if you have grown
used to being able to leave things there...

I don't know if the competition for memory is any different if done
through tmpfs vs the buffer pool for a disk backed filesystem.

I suspect it would be more efficient to have a tmpfs /tmp on an
system with an encrypted swap partition than separately
encrypted swap and /tmp partitions, because the encrypt/decrypt
would only be done on the former if the temporary file lives
long enough to be swapped out of memory..

The main advantage I see is that instead of having to have a
separate swap and tmp filesystem, I can have one combined
partition serving both purposes, and can change the size of the
tmp filesystem by a simple edit of fstab and a reboot.

I have occasionally had problems, for example, downloading an iso
image bigger than /tmp using netscape which insists on buffering
in /tmp even if that is not the final destination.

The only guidance I have seen on acceptible sizes for swap partitions
has been:
	a. a rule of thumb suggesting it should be the same size as physical
       memory.
    b. I think I read somewhere that Linux cannot use more than 2GB.

So I was thinking a swap partition equal to memory (1GB in this case)
plus the size of a modest /tmp partition (about 0.5GB) would be a
good compromise.

Are there any other things I should considder?

Regards,
DigbyT
-- 
Digby R. S. Tarvin                                          digbyt(at)digbyt.com
http://www.digbyt.com



Reply to: