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

Re: LVM root?



On Wed, Oct 11, 2006 at 07:55:07AM -0400, dtutty@porchlight.ca wrote:
> Isn't there a performance hit doing this?  If a programme is putting stuff
> in /tmp to otherwise reduce its memory footprint, does it make sense to
> circumvent that and put /tmp back in memory?  If a program is accessing
> both its /tmp file and another working file, with /tmp effectivly in
> swap, one has no controll over which spindle that page is on (assuming
> more than one disk) whereas if /tmp and /var/tmp are on a different
> spindle from the working directory they could be accessed at the same
> time.  
> 
> I wouldn't want to use /tmp for a temporary iso file.  If I get the iso
> created and then have a power failure, I don't want it gone when
> rebooting cleans out /tmp.  I thought that's what /var/tmp is for.
> 
> Disk space is cheap.  Other than saving space in /tmp when its not
> needed, is there an advantage to having it use tmpfs instead of a
> 'normal' device (partition, LV, whatever)?

/var/tmp is for things you do NOT want to loose on a reboot, but which
are otherwise still temporary files.  /tmp is for stuff that you really
don't care about, and which a reboot should remove (I know there used to
be a setting in debian that would clean /tmp on boot automatically).
For generating CD images I think I would use my home dir or some other
data storage location which makes sense for working on large files.
/tmp isn't it and never was.

Given the cost of ram, in general you should not be swapping at all.
/tmp is not for storing large files you intend to keep (like iso
images).  It is used to state information for some running programs,
temp files for compiling (when not doing -pipe), etc.  Having them in
ram makes them faster, and means the disk isn't kept busy writing files
to the disk that are going to be removed again in 10 seconds (if you are
lucky the cache will avoid them being written at all I guess, assuming
it is even that smart about write caching).  Solaris has been putting
/tmp in ram for many years now, and many linux systems do it too.  It
just makes sense (unless you have an old machine with almost no ram).

--
Len Sorensen



Reply to: