View previous topic :: View next topic |
Author |
Message |
batistuta Veteran
Joined: 29 Jul 2005 Posts: 1384 Location: Aachen
|
Posted: Tue Feb 21, 2006 5:43 pm Post subject: Speeding up compilation with tmpfs |
|
|
I know that this was mentioned 1000 times before, but after I've tried it today I was so impressed, that I thought about mentioning it again for all people new with Gentoo. I even think that the installation manual should say something about it.
tmpfs provides a way dinamically allocate RAM for your /tmp or /var/tmp partition. You can enable it and disable it as you wish on the fly, and it dramatically reduces your compilation time (at least for my system) by minimizing the I/O access.
Check it out |
|
Back to top |
|
|
irondog l33t
Joined: 07 Jul 2003 Posts: 715 Location: Voor mijn TV. Achter mijn pc.
|
Posted: Tue Feb 21, 2006 6:18 pm Post subject: |
|
|
Yep. Tmpfs rules. It doesn't claim free memory if it isn't in use. It's also swappable, which means it won't waste your free memory if tmpfs is populated with garbage.
You might want to add this to /etc/fstab Code: | none /var/tmp/portage tmpfs size=800M 0 0 |
There also is no need to clean /var/tmp/portage anymore. Every reboot your /var/tmp/portage is clean. _________________ Alle dingen moeten onzin zijn. |
|
Back to top |
|
|
pussi l33t
Joined: 08 May 2004 Posts: 727 Location: Finland
|
Posted: Tue Feb 21, 2006 7:26 pm Post subject: |
|
|
Wow! Thanks for the tip.
Finally I was able to get rid of the ccache ;) |
|
Back to top |
|
|
PaveQ Apprentice
Joined: 11 Feb 2005 Posts: 225 Location: Finland
|
Posted: Tue Feb 21, 2006 8:51 pm Post subject: |
|
|
pussi wrote: | Wow! Thanks for the tip.
Finally I was able to get rid of the ccache |
Why would you get rid of ccache? It still speeds up compiling no matter if you got tmpfs. They are completely separate things. |
|
Back to top |
|
|
pussi l33t
Joined: 08 May 2004 Posts: 727 Location: Finland
|
Posted: Tue Feb 21, 2006 10:26 pm Post subject: |
|
|
PaveQ wrote: | Why would you get rid of ccache? It still speeds up compiling no matter if you got tmpfs. They are completely separate things. | I know, but I actually tried compiling with both tempfs and ccache, and it was faster with tempfs only.
Anyway, I've been thinking of stopping using ccache because it takes too much disk space and tempfs makes compilations faster without that side effect. |
|
Back to top |
|
|
ThamanX n00b
Joined: 29 Nov 2005 Posts: 46 Location: AUT / Gmunden
|
Posted: Wed Feb 22, 2006 12:31 pm Post subject: |
|
|
I have 512 MB RAM installed in my System. How many RAM shoulde i use for it ??
Could it be that this Drive gets full ?? How can i prevent me from this ?? |
|
Back to top |
|
|
lnxz Guru
Joined: 03 Jul 2005 Posts: 472 Location: Earth
|
Posted: Wed Feb 22, 2006 12:37 pm Post subject: |
|
|
You should make a script that mounts a tmpfs on /var/tmp/portage before the emerge and unmounts it afterwards, because some packages will be larger than your ram space, which will cause the compilation to be terminated.
The script should probably empty /var/tmp/portage after each subsequent emerge, too (if you compile several packages at once). |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
|
Back to top |
|
|
Sheepdogj15 Guru
Joined: 07 Jan 2005 Posts: 430 Location: Backyard
|
Posted: Sun Mar 12, 2006 1:28 pm Post subject: |
|
|
in case anyone is still curious, tmpfs will swap out if you run out of RAM, whereas ramfs won't. otherwise the theory is the same: dynamically changes in size with how much data is in there, you specify a max size, etc. _________________ Sheepdog
Why Risk It? | Samba Howto |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6053 Location: Removed by Neddy
|
Posted: Sun Mar 12, 2006 1:36 pm Post subject: |
|
|
nyda wrote: | Or your compiler cache kicked in.
Code: |
root, root/ # genlop -t xorg-x11
* x11-base/xorg-x11
Tue Sep 7 16:19:39 2004 --> x11-base/xorg-x11-6.7.99.904
merge time: 49 minutes and 39 seconds.
Tue Sep 14 21:29:06 2004 --> x11-base/xorg-x11-6.8.0
merge time: 38 minutes and 51 seconds.
Fri Sep 17 15:27:04 2004 --> x11-base/xorg-x11-6.8.0-r1
merge time: 24 minutes and 20 seconds.
|
|
How long
Code: |
Fluid jrb # genlop -t xorg-x11
* x11-base/xorg-x11
Mon Apr 11 00:39:30 2005 >>> x11-base/xorg-x11-6.8.2-r1
merge time: 1 hour, 8 minutes and 19 seconds.
Sun Jun 5 05:15:37 2005 >>> x11-base/xorg-x11-6.8.2-r1
merge time: 1 hour, 32 minutes and 40 seconds.
Sun Jun 5 10:40:30 2005 >>> x11-base/xorg-x11-6.8.2-r1
merge time: 1 hour, 1 minute and 58 seconds.
Wed Jun 15 09:35:40 2005 >>> x11-base/xorg-x11-6.8.2-r2
merge time: 1 hour, 15 minutes and 25 seconds.
Tue Sep 13 00:38:00 2005 >>> x11-base/xorg-x11-6.8.2-r3
merge time: 1 hour, 4 minutes and 38 seconds.
Tue Sep 13 12:19:21 2005 >>> x11-base/xorg-x11-6.8.2-r3
merge time: 1 hour, 10 minutes and 43 seconds.
Sun Sep 18 04:34:36 2005 >>> x11-base/xorg-x11-6.8.2-r4
merge time: 1 hour, 23 minutes and 28 seconds.
Fri Sep 23 09:09:33 2005 >>> x11-base/xorg-x11-6.8.2-r5
merge time: 1 hour, 3 minutes and 12 seconds.
Sun Oct 9 02:21:54 2005 >>> x11-base/xorg-x11-6.8.2-r6
merge time: 55 minutes and 27 seconds.
Sat Mar 11 20:49:37 2006 >>> x11-base/xorg-x11-7.0-r1
[b]merge time: 4 seconds.[/b]
|
only took 4seconds for me _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
|