Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Can I gain considerable time by using tmpfs
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
certem
Tux's lil' helper
Tux's lil' helper


Joined: 14 Feb 2013
Posts: 127

PostPosted: Sun Mar 03, 2013 2:33 pm    Post subject: [Solved] Can I gain considerable time by using tmpfs Reply with quote

Hi all
I'm installing gentoo on a computer with specifications below:
Intel Pentium IV - 2.8 ghz
1 GB ram
256 MB Graphics Card
40 GB Hardisk

Compiling Chromium took about 10 hours and I needed to revdep-rebuild for some reason.
When I searched for ways to speed up installing I met something like this:
Code:
tmpfs   /var/tmp/portage        tmpfs   size=5G 0 0


in this url:http://www.eshlox.net/en/2012/07/29/gentoo-speeding-up-the-compilation-time/

I wonder if I start all over again and do it using tmpfs how much time I would gain.

Note: In my installation I followed the handbook and my partitions are the way mentioned in the handbook. I don't want to use binaries.

Edit: Solved


Last edited by certem on Sun Mar 03, 2013 6:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4681
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 03, 2013 2:43 pm    Post subject: Reply with quote

You have 1 GB of RAM, tempfs uses RAM instead of hard drive.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32098
Location: 56N 3W

PostPosted: Sun Mar 03, 2013 2:51 pm    Post subject: Reply with quote

certem,

tmpfs doesn't actually save very much. It puts things in RAM instead of writing them to disk.
However, if you have the RAM for this, the temporary files that get written to disk stay in the buffers in RAM anyway.
The only overhead is setting up the DMA for the HDD transfer and the use of RAM bandwidth for the disk transfer.

You need about 4G RAM for this to happen with most packages.

From memory, you can't usefully use 4G on a P4.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
lexflex
Apprentice
Apprentice


Joined: 05 Mar 2006
Posts: 192
Location: the Netherlands

PostPosted: Sun Mar 03, 2013 2:56 pm    Post subject: Reply with quote

Since ram is faster then disk, it might indeed speed up your emerge-times.
More on this:
http://www.gentoo-wiki.info/TIP_Speeding_up_portage_with_tmpfs
and elsewhere on this forum; many people also use a tempfs to reduce ssd read/writes.

But indeed:
Jaglover wrote:
You have 1 GB of RAM, tempfs uses RAM instead of hard drive.

In your example you use a ramdisk of 5G, and you have only 1 G of ram. The ' tmpfs'-disk should fit your memory :-)
So, you should try something like 750 MB max for your tempfsfile.

You might (if you have a more powerful machine at your disposal too) also want to take a look at distcc to distribute your compilation-tasks:
http://www.gentoo.org/doc/en/distcc.xml

Alex.

EDIT I see NeddySeagoon replied in the meantime:
As he explains indeed the 750 MB i suggest might not be enough, so in that case indeed it wont help you...
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1135
Location: Motown

PostPosted: Sun Mar 03, 2013 3:17 pm    Post subject: Reply with quote

Indeed, with only 1GB of ram you would not be able to compile www-client/chromium with the amount of memory you could spare for a /var/tmp/portage residing in tmpfs. A recent Firefox build required over 6GB for /var/tmp/portage and I had to bump my tmpfs space (previously maxed it at 5GB) to accommodate it:
Code:
tmpfs                   /var/tmp/portage        tmpfs   noatime,size=7000M,mode=0777    0 0

But with 32GB it is not problematic. And, of course, you can't use all of your memory for tmpfs space.

BTW, there's no need to "start all over" to do something like this. You could simply manually mount /var/tmp/portage in tmpfs (it will override) or add the above line (adjusting the size parameter) to the bottom of your /etc/fstab. You could try it with a smaller size, such as 256K on some small builds but when you need more space you'll have to umount the tmpfs based /var/tmp/portage and let the physical file system on the hard drive take over.

Outside of a major upgrade adding more memory (RAM) should buy you some performance benefits with a minimal investment.

Chris
_________________
What I need is an exact list of specific unknown problems we might encounter.
Back to top
View user's profile Send private message
certem
Tux's lil' helper
Tux's lil' helper


Joined: 14 Feb 2013
Posts: 127

PostPosted: Sun Mar 03, 2013 6:41 pm    Post subject: Reply with quote

Thank you for the replies.
This thread has been a very valuable reference for me.
I decided not to break the "long way" compilation right now but next times I'll try distcc and think about putting more ram.
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