16183 [Solved] Using a ramdisk for faster port compiling - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

Installation and Maintenance of FreeBSD Ports or Packages Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Reply
 
Thread Tools Display Modes
  #1  
Old April 26th, 2012, 16:22
ring_zero ring_zero is offline
Junior Member
 
Join Date: Mar 2011
Location: US
Posts: 67
Thanks: 13
Thanked 21 Times in 11 Posts
Default Using a ramdisk for faster port compiling

Has anyone tried using a ramdisk for optimized/faster compilation of ports? I added eight GB of RAM to this machine rather whimsically, (it's so cheap now), and am trying to come up with different ways of using it. I liked the idea of a ramdisk to speed up compilation, but I have no idea where to mount it.

Last edited by DutchDaemon; April 27th, 2012 at 01:32.
Reply With Quote
  #2  
Old April 26th, 2012, 16:25
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,860
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Mount it anywhere you like and set WRKDIRPREFIX. See ports(7) what it does.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
ring_zero (April 26th, 2012)
  #3  
Old April 26th, 2012, 16:26
kpa kpa is offline
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,141
Thanks: 46
Thanked 512 Times in 433 Posts
Default

Mount it somewhere under /var, for example /var/ports/tmp and set the work directory for ports in /etc/make.conf like this:

Code:
WRKDIRPREFIX=/var/ports/tmp
Reply With Quote
The Following User Says Thank You to kpa For This Useful Post:
ring_zero (April 26th, 2012)
  #4  
Old April 26th, 2012, 16:54
ring_zero ring_zero is offline
Junior Member
 
Join Date: Mar 2011
Location: US
Posts: 67
Thanks: 13
Thanked 21 Times in 11 Posts
Default

Works rather well. Thanks.
Reply With Quote
  #5  
Old June 15th, 2012, 09:26
cabriofahrer cabriofahrer is offline
Junior Member
 
Join Date: Mar 2009
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sounds interesting, but I don't understand why with the above given path in /var the work directory is moved into RAM? What am I missing?

Last edited by DutchDaemon; June 15th, 2012 at 11:30.
Reply With Quote
  #6  
Old June 15th, 2012, 09:57
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,860
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Quote:
Originally Posted by cabriofahrer View Post
Sounds interesting, but I don't understand why with the above given path in /var the work directory is moved into RAM? What am I missing?
/var/ports/tmp/ is the mountpoint where the RAM disk is mounted on. But it's just an example. You can mount it anywhere you like as long as WRKDIRPREFIX points to it.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #7  
Old June 15th, 2012, 11:32
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,939
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

I'll give you one local example:

/etc/fstab
Code:
tmpfs			/staging	tmpfs	rw		0	0
/etc/make.conf
Code:
WRKDIRPREFIX=/staging
That's all you need.

df -h
Code:
tmpfs           9.9G    4.0k    9.9G     0%    /staging
ls -ld /staging
Code:
drwxr-xr-x  3 root  wheel  40 Jun 15 12:19 /staging
Just ran make on a test port with some dependencies to show what happens:

$ find /staging -type d
Code:
/staging
/staging/usr
/staging/usr/ports
/staging/usr/ports/misc
/staging/usr/ports/misc/unclutter
/staging/usr/ports/misc/unclutter/work
/staging/usr/ports/misc/unclutter/work/unclutter
/staging/usr/ports/devel
/staging/usr/ports/devel/imake
/staging/usr/ports/devel/imake/work
/staging/usr/ports/devel/imake/work/imake-1.0.4
/staging/usr/ports/devel/imake/work/imake-1.0.4/.deps
/staging/usr/ports/devel/gccmakedep
/staging/usr/ports/devel/gccmakedep/work
/staging/usr/ports/devel/gccmakedep/work/gccmakedep-1.0.2
/staging/usr/ports/devel/makedepend
/staging/usr/ports/devel/makedepend/work
/staging/usr/ports/devel/makedepend/work/makedepend-1.0.3
/staging/usr/ports/devel/makedepend/work/makedepend-1.0.3/tests
/staging/usr/ports/devel/makedepend/work/makedepend-1.0.3/tests/28045
/staging/usr/ports/devel/makedepend/work/makedepend-1.0.3/.deps
/staging/usr/ports/x11
/staging/usr/ports/x11/xorg-cf-files
/staging/usr/ports/x11/xorg-cf-files/work
/staging/usr/ports/x11/xorg-cf-files/work/xorg-cf-files-1.0.4
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #8  
Old June 15th, 2012, 15:18
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,851
Thanks: 445
Thanked 1,829 Times in 1,495 Posts
Default

Time a big port compile both from RAM and off disk. Reboot before each to clear filesystem cache. With buildworld, I found essentially zero difference putting /usr/obj in a tmpfs.
Reply With Quote
  #9  
Old June 15th, 2012, 15:28
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,939
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

I like my SSD's too much ;p)
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #10  
Old June 15th, 2012, 15:46
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,851
Thanks: 445
Thanked 1,829 Times in 1,495 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
I like my SSD's too much ;p)
That's an interesting point. Certainly those multiple builds of LibreOffice didn't do mine any good.
Reply With Quote
  #11  
Old June 15th, 2012, 15:58
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,939
Thanks: 30
Thanked 1,932 Times in 1,351 Posts
Default

In fact, all of my caches (browsers, etc.) are on a tmpfs as well.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #12  
Old June 16th, 2012, 21:29
sim's Avatar
sim sim is offline
Member
 
Join Date: Nov 2008
Location: The Spacetime Continuum
Posts: 157
Thanks: 34
Thanked 5 Times in 3 Posts
Default

This is a somewhat tangential observation/question...

Running ZFS with 8GB (total) RAM, I note that even on heavy builds (world etc), the HD light only pulses very briefly and occasionally - e.g. one single short flash every few seconds. (I can't remember what it used to be like when I used to run UFS). So, assuming there's a decent caching infrastructure in place, like ZFS's L2ARC, is there something to be said for letting the system use memory as it sees fit? Is there much to be gained by manually specifying a RAM disc these days?

sim
__________________
There's no place like ~
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ZFS Clone at RAMDISK is it possible? stassik Storage 1 January 31st, 2012 08:35
[Solved] Compiling and installing a port as an unprivileged user kpedersen Installation and Maintenance of FreeBSD Ports or Packages 4 March 7th, 2011 17:56
Compiling port issues izaak86 Installation and Maintenance of FreeBSD Ports or Packages 0 November 21st, 2010 06:23
Cross compiling a port olivier Other Architectures 0 February 27th, 2010 18:05
[Solved] Finding needed ports without compiling them, for a port overmind Installation and Maintenance of FreeBSD Ports or Packages 3 January 22nd, 2010 20:31


All times are GMT +1. The time now is 12:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0