Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which to mount as tmpfs, /tmp or /var/tmp/portage?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Splooshie123
n00b
n00b


Joined: 16 Apr 2012
Posts: 27

PostPosted: Wed Jul 04, 2012 11:21 am    Post subject: Which to mount as tmpfs, /tmp or /var/tmp/portage? Reply with quote

I want to mount the /tmp folder in ram but I don't know whether it would not be better to do that with /var/tmp/portage instead.

Which folder generally uses more space? If the combined size is small enough, I might even decide to have both as tmpfs.
Back to top
View user's profile Send private message
jormartr
Apprentice
Apprentice


Joined: 02 Jan 2008
Posts: 174

PostPosted: Wed Jul 04, 2012 12:43 pm    Post subject: Reply with quote

/tmp is a general temp folder, while /var/tmp/portage is used by portage when compiling.

The use on the first depends on the applications that you use and might use /tmp.

The second one will need quite space for portage to run.

I personally use tmpfs on /tmp, and do a bind mount of /tmp/var_tmp_portage on /var/tmp
Back to top
View user's profile Send private message
Splooshie123
n00b
n00b


Joined: 16 Apr 2012
Posts: 27

PostPosted: Thu Jul 05, 2012 9:48 am    Post subject: Reply with quote

I'm mostly browsing the Web with the computer. Firefox seems to keep its own cache in the home folder so /tmp is less than a megabyte. So /tmp is safe enough.

/var/tmp/portage I'll just have to try experimenting...
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Thu Jul 05, 2012 3:52 pm    Post subject: Reply with quote

I am using from a while /tmp on tmpfs.
I am using chromium cache and portage compiling for almost all the emerging (chromium and libreoffice on hard drive) on it.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Jul 05, 2012 7:07 pm    Post subject: Reply with quote

I make them both 4GB and have extra swap space.
Back to top
View user's profile Send private message
Splooshie123
n00b
n00b


Joined: 16 Apr 2012
Posts: 27

PostPosted: Sat Jul 07, 2012 1:27 am    Post subject: Reply with quote

Ant P. wrote:
I make them both 4GB and have extra swap space.


Can you clarify? Do you mean you mount both as tmpfs and set the size for each to 4GB?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Sat Jul 07, 2012 1:45 am    Post subject: Reply with quote

In my experience the /tmp project has marginal value, but the /var/tmp/portage one makes a huge difference when upgrading your packages.

Using tmpfs for where your web browser stores things is irrelevant. No matter how slow a hard disk is, it's gonna be faster than your internet connection.

I've used tmpfs quite a bit, and here's my strategy:

  1. Install normally.
  2. Use your machine, and figure out what operations you spend time waiting for the computer to finish, and which use disk heavily.
  3. For the worst offender (portage for example) you find out where it writes its temp storage to.
  4. Time an operation (compiling Libre for example) as a reference. For fairness, install it untimed first, the unmerge it, then time the re-merge. This way you don't have inaccurate results for all the additional dependencies that come along for the ride.
  5. Mount that are as tmpfs, and make it plenty big because chances are that RAM will never be used or swapped anyway.
  6. Try the app again and measure the improvement in performance.


FWIW I only found a few places that made sense for me, and /tmp was not one of them.

I submit that before you play with this, you get your system to a state where you never use more than half your RAM for actual running of the computer. I have 12g, and I have 4 disks each of which has a 12g swap partition. I use them all in theory, but AFAICT no bytes have ever been written to any of them except when my system hibernates or sleeps.

IMO the easiest, best way you can improve your system's speed is to increase RAM to a stupidly large amount. RAM is cheaper than it has ever been, and it doesn't take a lot to get good performance. Linux uses your extra RAM as a disk cache, so if you leave your system running most of the time it will eventually fill your RAM up with disk cache. Usually by the end of a week of uptime, I get about 10g used total, and by the end of a month it's 11g or so. Once everything is cached, everything starts up really fast.

The absolutely worst thing you can do is to have so little RAM that you actually use SWAP for its original purpose. SWAP algorithms are really good at deciding what needs to go out, but an app that things it's storing on RAM but instead is waiting for a disk to seek-write-flush-etc is going to really kill your performance.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum