1 |
On Wednesday 06 May 2009 15:43:22 Mark Haney wrote: |
2 |
> Volker Armin Hemmann wrote: |
3 |
> > On Mittwoch 06 Mai 2009, Mark Haney wrote: |
4 |
> >> Duncan wrote: |
5 |
> >>> Consider pointing PORTAGE_TMPDIR at a tmpfs. |
6 |
> >>> |
7 |
> >>> The idea is based on the fact that everything portage does in its |
8 |
> >>> tmpdir (/var/tmp by default) is temporary, erased as soon as it's done |
9 |
> >>> emerging that package. Since tmpfs uses swap backed memory, |
10 |
> >>> worst-case, it has to write to swap -- that is, to disk, which is where |
11 |
> >>> it would otherwise be writing ALL the temporary files. With memory |
12 |
> >>> access so much faster than disk access, every file that's erased before |
13 |
> >>> it hits disk saves time, and it can make a BIG difference in emerge |
14 |
> >>> times. |
15 |
> >> |
16 |
> >> Duncan, you talk about tmpfs and I'm suddenly interested in trying this |
17 |
> >> out. My question is, how much space do you allocate for the tmpfs? I |
18 |
> >> know it'll fall back to swap if I'm out of space there, but what works |
19 |
> >> well for you? I have (currently) 1GB RAM on this system, but I'm |
20 |
> >> getting ready to order more to get me to 4GB. |
21 |
> > |
22 |
> > 2gb. That is enough for almost everything. Not enough for openoffice. |
23 |
> > tmpfs 2,0G 3,2M 2,0G 1% /var/tmp/portage |
24 |
> > tmpfs 1,0G 116K 1,0G 1% /tmp |
25 |
> |
26 |
> Now how is that going to play out when I only have 1GB of RAM? |
27 |
|
28 |
IMHO You shouldn't use tmpfs for the PM temp dir, until you can give that |
29 |
around 2GB, which shouldn't be more than half of your total memory. |
30 |
|
31 |
In your case there still could be some speed improvement if you have enough |
32 |
swap space. This because smaller packages wouldn't use disks at all, but still |
33 |
allowing bigger compiles to be carried out as the tmpfs would use swap when |
34 |
the memory starts to run low. |
35 |
|
36 |
|
37 |
When I had only 2GB of memory I used a dedicated RAID 0 (striped) ext2fs |
38 |
partition for the PM temp dir. As in this use case the raw speed of the used |
39 |
FS is more important than the reliability. |
40 |
|
41 |
Now I have 8GB of memory and I use 5GB and 2GB limits for the PM temp and the |
42 |
sys temp. |