Re: /tmp on mfs

2009-10-20 Thread ill...@gmail.com
2009/10/20 Christopher Hilton :
> Reading the list yesterday I came across a little controversy about swap
> backed /tmp filesystems. I've been using this in my /etc/rc.conf
>
> tmpmfs="YES"            # Set to YES to always create an mfs /tmp, NO to
> never
> tmpsize="1g"            # Size of mfs /tmp if created
> tmpmfs_flags="-S -o async,noexec"       # Extra mdmfs options for the mfs
> /tmp

Not to butt in (and tangentially, anyway), but noexec on /tmp will cause
"make installworld" to fail.  Or at least, it did last time I tried it
(2005?).  If
you never build world, I guess this is completely unimportant.

-- 
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: /tmp on mfs

2009-10-20 Thread Giorgos Keramidas
On Tue, 20 Oct 2009 11:20:38 -0400, Christopher Hilton  
wrote:
> Reading the list yesterday I came across a little controversy about swap
> backed /tmp filesystems. I've been using this in my /etc/rc.conf
>
> tmpmfs="YES"# Set to YES to always create an mfs /tmp, NO to never
> tmpsize="1g"# Size of mfs /tmp if created
> tmpmfs_flags="-S -o async,noexec"   # Extra mdmfs options for the mfs /tmp
>
> To mount /tmp on a swap backed filesystem. I've been assuming that
> data stored in the /tmp directory was held in RAM and then written to
> the swap space only when the system had a more pressing need for the
> RAM. I typically configure my systems with swap == 2 * RAM or more.
> And on the systems in question I have at least 1Gb of RAM. I was
> hoping to use this trick to enhance the performance of the postgresql
> database (temp_tablespace=/tmp/pgsql/) Is my assumption about
> where the data in a temporary file is stored incorrect?

Hi Christopher,

The rc.conf(5) options for `tmpmfs' and `varmfs' use the mdmfs(8) to
create the respective filesystems.  The default behavior of mdmfs(8) is
to create a swap-backed filesystem.  Swap-backed filesystems, as the
manpage of mdconfig(8) described them, work exactly as you wrote:

swap Storage for this type of memory disk is allocated
 from buffer memory.  Pages get pushed out to the
 swap when the system is under memory pressure,
 otherwise they stay in the operating memory.  Using
 swap backing is generally preferable over malloc
 backing.

So your understanding of the way tmpmfs behaves is fine.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: /tmp on mfs

2009-10-20 Thread Vincent Hoffman
Christopher Hilton wrote:
> Reading the list yesterday I came across a little controversy about
> swap backed /tmp filesystems. I've been using this in my /etc/rc.conf
>
> tmpmfs="YES"# Set to YES to always create an mfs /tmp, NO
> to never
> tmpsize="1g"# Size of mfs /tmp if created
> tmpmfs_flags="-S -o async,noexec"   # Extra mdmfs options for the
> mfs /tmp
>
> To mount /tmp on a swap backed filesystem. I've been assuming that
> data stored in the /tmp directory was held in RAM and then written to
> the swap space only when the system had a more pressing need for the
> RAM. I typically configure my systems with swap == 2 * RAM or more.
> And on the systems in question I have at least 1Gb of RAM. I was
> hoping to  use this trick to enhance the performance of the postgresql
> database (temp_tablespace=/tmp/pgsql/) Is my assumption about
> where the data in a temporary file is stored incorrect?
>
Thats certainly always been my interpretation of the manpage.
  "Storage for this type of memory disk is allocated
from
  buffer memory.  Pages get pushed out to the swap when
  the system is under memory pressure, otherwise
they stay
  in the operating memory."

If thats not the case I'd be interested to know how it does work.

Vince
> -- Chris
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


/tmp on mfs

2009-10-20 Thread Christopher Hilton
Reading the list yesterday I came across a little controversy about  
swap backed /tmp filesystems. I've been using this in my /etc/rc.conf


tmpmfs="YES"# Set to YES to always create an mfs /tmp, NO  
to never

tmpsize="1g"# Size of mfs /tmp if created
tmpmfs_flags="-S -o async,noexec"   # Extra mdmfs options for the  
mfs /tmp


To mount /tmp on a swap backed filesystem. I've been assuming that  
data stored in the /tmp directory was held in RAM and then written to  
the swap space only when the system had a more pressing need for the  
RAM. I typically configure my systems with swap == 2 * RAM or more.  
And on the systems in question I have at least 1Gb of RAM. I was  
hoping to  use this trick to enhance the performance of the postgresql  
database (temp_tablespace=/tmp/pgsql/) Is my assumption about  
where the data in a temporary file is stored incorrect?


-- Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"