Re: how to disable tmpfs

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

 



Once upon a time, Dennis Kaptain <dennis.kaptain@xxxxxxxxx> said:
> It still doesn't seem like an ideal way to handle /tmp when I have a
> perfectly good partition and swapping is a major performance killer.
> I'd rather disk access wait time is caused by accessing /tmp when I
> need to rather than swapping tmpfs in and out for a program.

Swapping tmpfs files to swap is no more of a performance killer than
writing /tmp to disk to begin with (the same data would be written to
the same disk, just in a little bit different format and location).

When a program writes data to disk, it goes through the kernel page
cache, to the filesystem layer, to the block layer, and then to disk.
The filesystem has to allocate space (which means other writes to disk,
updating block allocations, directories, etc.).  The blocks are cached
in the page cache in case they are read later.  If the kernel needs RAM,
it can throw them away.

tmpfs lives directly in the page cache.  So, when a program writes to a
tmpfs file, it goes to the page cache and stops.  Later, if the kernel
needs RAM, it can push those pages to disk (swap space).

The only difference between /tmp on disk and tmpfs is when pages get
pushed to disk.  In a system with sufficient RAM to hold the normal /tmp
contents (which aren't very big under most circumstances), they never
get pushed to disk with tmpfs, and performance is faster.

The only downside to /tmp-on-tmpfs is that it is limited in size, based
on available RAM.  Ideally, it would be based on swap size, or total
RAM+swap, but that's harder to do.  However, Fedora defaults to a root
filesystem that isn't huge (with a separate /home), so the size of /tmp
is still limited.  /tmp was never supposed to be about holding arbitrary
sized chunks of data.

-- 
Chris Adams <linux@xxxxxxxxxxx>
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux