Re: swap partition leads to instability?

2013-05-30 Thread RW
On Wed, 29 May 2013 19:52:02 + (UTC)
jb wrote:

 RW rwmaillists at googlemail.com writes:
 
  

  BTW you mean paging, or swap use, rather that swapping. Linux
  supports only paging, so it can be taken as read that swapping
  means paging, but FreeBSD supports both.
 
 Yes, there is some confusion about the diff, if any, between paging
 and swapping.
 
 Paging - copying or moving pages between physical memory (RAM) and
 secondary storage (e.g. hard disk), in both directions.
 Swapping - nowdays is synonymous with paging.
   But its history is as follows (per Wikipedia):

This is a bit Linux-centric.

 You say that FB supports both, Linux supports paging only.
 Well, Linux utilizes swap space as part of virtual memory.
 So, can you elaborate more on that - what is the essence of the diff,
 why should I avoid the term swapping when referring to Linux,
 assuming VMM systems on both ?

You page-out pages and swap-out processes. 

When FreeBSD is very short of memory it swaps-out entire processes to
concentrate the memory in the running processes. Linux goes directly
from paging to killing processes.

You can also set vm.swap_idle_enabled to allow idle processes to be
swapped during normal use. This may help if a server has a lot memory
tied up in processes that tend to be idle for long periods of time -
traditionally used on shell servers. These days you'd probably want to
be adding more memory.
___
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: swap partition leads to instability?

2013-05-30 Thread jb
RW rwmaillists at googlemail.com writes:

 ... 
  Yes, there is some confusion about the diff, if any, between paging
  and swapping.
  
  Paging - copying or moving pages between physical memory (RAM) and
  secondary storage (e.g. hard disk), in both directions.
  Swapping - nowdays is synonymous with paging.
But its history is as follows (per Wikipedia):
 
 This is a bit Linux-centric.
 ...
 You page-out pages and swap-out processes. 
 
 When FreeBSD is very short of memory it swaps-out entire processes to
 concentrate the memory in the running processes. Linux goes directly
 from paging to killing processes.

That was helpful - knowing the details of VMM implementation in various OSs
helps understand the generalizations, with exceptions ...
jb


___
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: swap partition leads to instability?

2013-05-30 Thread jb
RW rwmaillists at googlemail.com writes:

 
 On Sun, 26 May 2013 12:36:42 + (UTC)
 jb wrote:
 
  But, swapping is also a symptom, not a problem.
  It is never a good idea to let it get to that point.
 
 No, there are thing that are better on disk than in memory. The most
 common example is tmpfs. It's much better that files left on tmpfs can
 sent to disk rather tying up physical memory indefinitely. 

Yup, tmpfs - in virtual memory. That's an unfortunate excuse.
But before its content are swapped out, the critical system like a server
will be destabilized and show lame performance.
The tmp-on-tmpfs has so many disadvantages that it is difficult to count and
follow all of them.
jb



___
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: swap partition leads to instability?

2013-05-30 Thread RW
On Sun, 26 May 2013 18:48:18 -0500
Adam Vande More wrote:


 Um, that is wrong.  It is in fact the basically the point of TRIM.
 And SSD's typically use the best form of wear leveling and it's
 usually advisable to leave a bit of the drive unpartitioned/unused to
 ensure the wear leveling works optimally.

Would the UFS  default 8% reserve achieve that?
___
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: swap partition leads to instability?

2013-05-29 Thread jb
Fred Morcos fred.morcos at gmail.com writes:

 .. 
 The improvement effect can be
 noticed on large inputs. These algorithms will most probably perform quite
 badly on small inputs.

I think your concern has been addressed in review of various algos where base
case identification helped to avoid overhead cost in small problem sizes
relative to cache.
http://erikdemaine.org/papers/BRICS2002/paper.pdf

In light of available but not implemented better VMM algos, perhaps *BSD and
Linux could eliminate or reduce the need for:
- swap space
- swapping out RAM even if there is no lack of it
- overcommitment of memory (a bluff asking to be punished by OOM killer)
- OOM killer
Besides, they allow sloppy/dangerous programming.

jb


___
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: swap partition leads to instability?

2013-05-29 Thread Fred Morcos
On Wed, May 29, 2013 at 1:19 PM, jb jb.1234a...@gmail.com wrote:

 Fred Morcos fred.morcos at gmail.com writes:

  ..
  The improvement effect can be
  noticed on large inputs. These algorithms will most probably perform
 quite
  badly on small inputs.

 I think your concern has been addressed in review of various algos where
 base
 case identification helped to avoid overhead cost in small problem sizes
 relative to cache.
 http://erikdemaine.org/papers/BRICS2002/paper.pdf


I will check the paper out after work, but for clarification: Also,
properly written cache-oblivious algorithms tend to recursively decompose
the problem until it is small enough to fit in a cache and solve each part
iteratively. -- refers to the base case. The issue is when the input is
small enough to be solved faster iteratively but too large to fit in the
cache. Also note that this is extremely machine and cache-dependent. Still,
I will check the paper out :) thanks.



 In light of available but not implemented better VMM algos, perhaps *BSD
 and
 Linux could eliminate or reduce the need for:
 - swap space


I run Archlinux without any swap space on a workstation laptop without
problems. I occasionally fallocate a swapfile when I need to build GHC
(usually in /tmp to make use of tmpfs).


 - swapping out RAM even if there is no lack of it


Linux has a sysctl variable vm.swappiness which you can set to 0 or 1 out
of 100. Not sure how to achieve the same on FreeBSD, maybe one or more
combinations of the following?

vm.swap_idle_threshold2: 10
vm.swap_idle_threshold1: 2
vm.stats.vm.v_swappgsout: 236969
vm.stats.vm.v_swappgsin: 28411
vm.stats.vm.v_swapout: 92607
vm.stats.vm.v_swapin: 28285
vm.disable_swapspace_pageouts: 0
vm.defer_swapspace_pageouts: 0
vm.swap_idle_enabled: 0


 - overcommitment of memory (a bluff asking to be punished by OOM killer)
 - OOM killer
 Besides, they allow sloppy/dangerous programming.

 jb


 ___
 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


Re: swap partition leads to instability?

2013-05-29 Thread RW
On Sun, 26 May 2013 12:36:42 + (UTC)
jb wrote:


 But, swapping is also a symptom, not a problem.
 It is never a good idea to let it get to that point.

No, there are thing that are better on disk than in memory. The most
common example is tmpfs. It's much better that files left on tmpfs can
sent to disk rather tying up physical memory indefinitely. 

BTW you mean paging, or swap use, rather that swapping. Linux supports
only paging, so it can be taken as read that swapping means paging, but
FreeBSD supports both.
___
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: swap partition leads to instability?

2013-05-29 Thread RW
On Wed, 29 May 2013 13:57:22 +0200
Fred Morcos wrote:


 Linux has a sysctl variable vm.swappiness which you can set to 0 or 1
 out of 100. Not sure how to achieve the same on FreeBSD, maybe one or
 more combinations of the following?

You'll probably make things worse.

 vm.stats.vm.v_swappgsout: 236969
 vm.stats.vm.v_swappgsin: 28411
 vm.stats.vm.v_swapout: 92607
 vm.stats.vm.v_swapin: 28285

These are just information

 vm.disable_swapspace_pageouts: 0

I'm not entirely sure, but I think this just disables paging at
runtime - rather than compile time. 

 vm.defer_swapspace_pageouts: 0

IIRC this defers paging, but it can end up with the paging done on the
critical path rather in the background - it's usually a bad idea.


 vm.swap_idle_enabled: 0
 vm.swap_idle_threshold2: 10
 vm.swap_idle_threshold1: 2

This why you shouldn't confuse swapping and paging. These are about
actually swapping-out processes. It's mainly about reducing memory use
on multiuser systems where there many terminal idle at at any time. 
___
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: swap partition leads to instability?

2013-05-29 Thread Adam Vande More
On Wed, May 29, 2013 at 6:19 AM, jb jb.1234a...@gmail.com wrote:
 - overcommitment of memory (a bluff asking to be punished by OOM killer)

No self respecting Unix has an OOM by default.

 - OOM killer

Are you suggesting FreeBSD does this crap?

 Besides, they allow sloppy/dangerous programming.

Yup, in the kernel.

-- 
Adam Vande More
___
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: swap partition leads to instability?

2013-05-29 Thread Michael Sierchio
On Sun, May 26, 2013 at 6:17 PM, Adam Vande More amvandem...@gmail.comwrote:



 Normal dynamic wear leveling on a modern SSD will be better than
 imposing an FS- backed swap for 4GB partion occupying a small fraction
 of total drive space.


Quite so.

- M
___
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: swap partition leads to instability?

2013-05-29 Thread Warren Block

On Wed, 29 May 2013, Michael Sierchio wrote:

On Sun, May 26, 2013 at 6:17 PM, Adam Vande More amvandem...@gmail.com wrote: 


Normal dynamic wear leveling on a modern SSD will be better than
imposing an FS- backed swap for 4GB partion occupying a small fraction
of total drive space.


And you don't think the presence of TRIM--where the SSD can actually 
know which blocks are no longer in use--is worthwhile?

___
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: swap partition leads to instability?

2013-05-29 Thread Adam Vande More
On Wed, May 29, 2013 at 1:05 PM, Warren Block wbl...@wonkity.com wrote:
 And you don't think the presence of TRIM--where the SSD can actually know
 which blocks are no longer in use--is worthwhile?

As a whole, TRIM is worthwhile.  However when an SSD is
overprovisioned it provides a lot of benefits.  TRIM-less swap in this
case doesn't.  The PE rate of the worst MLC SSD's at this point is
@3000 AFAIK.  Given those figures and average desktop swap rate at my
estimation, prioritizing write endurance on an SSD is not
beneficial(especially with a SanForce).  If you are swapping
continuously something like ZeusRAM may be required.  There are
probably other solutions available as well as other 3rd party ones.
If you are swapping a lot, the best case is usually to add RAM.

--
Adam Vande More
___
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: swap partition leads to instability?

2013-05-29 Thread Adam Vande More
PS -- Moderating questions@ is just awful.  I'm disappointed.

On Wed, May 29, 2013 at 1:34 PM, Adam Vande More amvandem...@gmail.com wrote:
 On Wed, May 29, 2013 at 1:05 PM, Warren Block wbl...@wonkity.com wrote:
 And you don't think the presence of TRIM--where the SSD can actually know
 which blocks are no longer in use--is worthwhile?

 As a whole, TRIM is worthwhile.  However when an SSD is
 overprovisioned it provides a lot of benefits.  TRIM-less swap in this
 case doesn't.  The PE rate of the worst MLC SSD's at this point is
 @3000 AFAIK.  Given those figures and average desktop swap rate at my
 estimation, prioritizing write endurance on an SSD is not
 beneficial(especially with a SanForce).  If you are swapping
 continuously something like ZeusRAM may be required.  There are
 probably other solutions available as well as other 3rd party ones.
 If you are swapping a lot, the best case is usually to add RAM.

 --
 Adam Vande More



-- 
Adam Vande More
___
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: swap partition leads to instability?

2013-05-29 Thread jb
RW rwmaillists at googlemail.com writes:

 
 On Sun, 26 May 2013 12:36:42 + (UTC)
 jb wrote:
 
  But, swapping is also a symptom, not a problem.
  It is never a good idea to let it get to that point.
 
 No, there are thing that are better on disk than in memory. The most
 common example is tmpfs. It's much better that files left on tmpfs can
 sent to disk rather tying up physical memory indefinitely. 
 
 BTW you mean paging, or swap use, rather that swapping. Linux supports
 only paging, so it can be taken as read that swapping means paging, but
 FreeBSD supports both.

Yes, there is some confusion about the diff, if any, between paging and 
swapping.

Paging - copying or moving pages between physical memory (RAM) and secondary
  storage (e.g. hard disk), in both directions.
Swapping - nowdays is synonymous with paging.
  But its history is as follows (per Wikipedia):
  Historically, swapping referred to moving from/to secondary storage a whole
  program at a time, in a scheme known as roll-in/roll-out. In the 1960s, after
  the concept of virtual memory was introduced — in two variants, either using
  segments or pages — the term swapping was applied to moving, respectively,
  either segments or pages, between memory and disk. Today with the virtual
  memory mostly based on pages, not segments, swapping became a fairly close
  synonym of paging.

You say that FB supports both, Linux supports paging only.
Well, Linux utilizes swap space as part of virtual memory.
So, can you elaborate more on that - what is the essence of the diff, why
should I avoid the term swapping when referring to Linux, assuming VMM
systems on both ?

jb


___
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: swap partition leads to instability?

2013-05-29 Thread Adam Vande More
On Wed, May 29, 2013 at 2:52 PM, jb jb.1234a...@gmail.com wrote:
 Well, Linux utilizes swap space as part of virtual memory.


As does every other Unix.



--
Adam Vande More
___
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: swap partition leads to instability?

2013-05-29 Thread Paul Kraus
On May 29, 2013, at 3:52 PM, jb jb.1234a...@gmail.com wrote:

 Yes, there is some confusion about the diff, if any, between paging and 
 swapping.
 
 Paging - copying or moving pages between physical memory (RAM) and secondary
  storage (e.g. hard disk), in both directions.
 Swapping - nowdays is synonymous with paging.

 You say that FB supports both, Linux supports paging only.
 Well, Linux utilizes swap space as part of virtual memory.
 So, can you elaborate more on that - what is the essence of the diff, why
 should I avoid the term swapping when referring to Linux, assuming VMM
 systems on both ?

When I started working professionally with Unix systems in 1995, I was 
taught that paging was the process of copying least used pages of RAM onto 
disk so that the RAM could be freed if the system needed more RAM. Swapping was 
the process of moving an entire program from RAM to disk in order to free up 
RAM.

In other words, a process can be swapped out and placed on disk until 
it comes up to run again, at which point it can be swapped in and executed.

I think that much of the confusion comes from the use of the SWAP 
device by the PAGING system. When the concept of paging came about, it just 
used the already existing SWAP space to store it's paged out pages of memory.

On the systems I worked on at the time (SunOS / Solaris), paging was a 
sign of pressure on the physical memory (RAM) of a system, swapping was a sign 
of _severe_ physical memory pressure. This was a time when we configured 2 to 4 
times the amount of physical RAM as SWAP space. RAM was very expensive and hard 
drives just expensive :-) It was common on a normally operating system to see 
the page scanner* running up to 100 times per second. A scan rate of over 100 
was considered a sign of pressure on RAM that needed to be addressed, any 
SWAPing was considered a sign that the system needed more physical RAM.

Today RAM is so cheap that _any_ paging is often considered bad and an 
indication that more Ram should be added.

*Solaris Page Scanner: This is a kernel level process that wakes up, examines 
the amount of free RAM, and takes action based on that value. The thresholds 
are all dynamic and based on the amount of RAM in the system. Above a high 
water mark the scanner does nothing. As the amount of free RAM drops, various 
pages of RAM are copied to SWAP space and the RAM freed. Eventually, if the 
amount of free Ram falls low enough, even parts of the kernel will be paged 
out. This is very bad and can lead to a system thrashing where it spends the 
vast majority of it's time just paging in and out and not actually getting 
anything done.

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company

___
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: swap partition leads to instability?

2013-05-28 Thread jb
Follow up comment.

It has been pointed out to me that there is Varnish software taking advantage 
of system VMM and swap space.

Well, there are cache-oblivious algorithms that perform as well, and so they
make the above (disk access model; cache-aware model) unnecessary
(obsolete ?) and are superior in their generality.

jb


___
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: swap partition leads to instability?

2013-05-28 Thread Fred Morcos
On Tue, May 28, 2013 at 8:42 PM, jb jb.1234a...@gmail.com wrote:

 Follow up comment.

 It has been pointed out to me that there is Varnish software taking
 advantage
 of system VMM and swap space.

 Well, there are cache-oblivious algorithms that perform as well, and so
 they
 make the above (disk access model; cache-aware model) unnecessary
 (obsolete ?) and are superior in their generality.


Note that such cache-oblivious algorithms cannot be trivially applied to
any problem. Also, properly written cache-oblivious algorithms tend to
recursively decompose the problem until it is small enough to fit in a
cache and solve each part iteratively. The improvement effect can be
noticed on large inputs. These algorithms will most probably perform quite
badly on small inputs.


 jb


 ___
 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


Re: swap partition leads to instability?

2013-05-28 Thread Terje Elde
On 26. mai 2013, at 10:58, M. V. bored_to_deat...@yahoo.com wrote:
 But recently I heard from a FreeBSD expert that I shouldn't have swap 
 partition for my server, and having swap partition could make my server 
 unstable

Any chance this could be a simple misunderstanding?

That he objected to the thought of the server swapping on an SSD (or 
whereever), more than the idea of having the partition itself?

If you're heavily swapping on an SSD with no redundancy, sooner or later it 
will kill your server. 

Generally though, havin too little memory will also give issues. ;)

I usually recommend viewing swap like you view filesystems. If you don't want 
downtime or dataloss when it dies, plan for failiure, and use gmirror or zfs 
mirror and zvol. 

Terje

___
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: swap partition leads to instability?

2013-05-27 Thread M. V.
jb jb.1234abcd at gmail.com writes:

 M. V. bored_to_death85 at yahoo.com writes:

 recently I heard from a FreeBSD expert that I shouldn't have
 swap partition for my server, and having swap partition could
 make my server unstable. 

 I think your FB expert was up to something. I bet he spoke out
 of experience.
 
 Swapping by itself can decrease system reliability due to possible
 data corruption on swap disk or during two-way transfers, with 

 subsequent incorrect RAM and machine crash.

 But, swapping is also a symptom, not a problem.
 It is never a good idea to let it get to that point.
...

 http://blog.jcole.us/2010/09/28/mysql-swap-insanity-and-the-numa-architecture/


Very interesting point.
- do you think this could hurt my server's stability too? (most of its work is 
a noticeable amount of packet-forwarding, and other network services, like 
firewall, dhcp server, ntp server, etc)
- if so, in what conditions? can I do something to prevent this? or should I 
just get rid of the swap partition?

- does swap partition do any good for me at all? I mean if we even suppose 
nothing bad happens because of it, is it worth risking to keep it? 


thank you.
___
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: swap partition leads to instability?

2013-05-26 Thread Erich Dollansky
Hi,

On Sun, 26 May 2013 01:58:32 -0700 (PDT)
M. V. bored_to_deat...@yahoo.com wrote:

 I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive.
 it's partitioned as normal (/ , /tmp, /var , /usr and swap) for a
 long time now. But recently I heard from a FreeBSD expert that I
 shouldn't have swap partition for my server, and having swap
 partition could make my server unstable. this was so strange for me,
 and I searched a lot but couldn't find a reason for this claim.
 
because it is a false claim. I never ever have had any system with
working hard, that gave a problem because of the swap space.

Erich
___
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: swap partition leads to instability?

2013-05-26 Thread Polytropon
On Sun, 26 May 2013 16:09:06 +0700, Erich Dollansky wrote:
 Hi,
 
 On Sun, 26 May 2013 01:58:32 -0700 (PDT)
 M. V. bored_to_deat...@yahoo.com wrote:
 
  I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive.
  it's partitioned as normal (/ , /tmp, /var , /usr and swap) for a
  long time now. But recently I heard from a FreeBSD expert that I
  shouldn't have swap partition for my server, and having swap
  partition could make my server unstable. this was so strange for me,
  and I searched a lot but couldn't find a reason for this claim.
  
 because it is a false claim. I never ever have had any system with
 working hard, that gave a problem because of the swap space.

I think the problem here is that he's using a SSD.
As soon as the swap partition is being in heavy use,
which means it receives many writes, this may lead
to the SSD wearing out, decreasing its lifetime.

Swap space usually does not make a system unstable.
Sometimes, the opposite is true. :-)

So if you're using a SSD, you can apply certain
optimizations to increase its lifetime so it can be
in use for several years (running 24/7). Here are
some suggestions -- check if they are useful in your
specific case!

# newfs -m 0 -i 16384 -b 16384 -f 2048 -U /dev/ada0a

This assumes that you don't have created any
slices, just one bootable partition covering the
whole disk (therefor ada0a).

Create a swapfile like this:

# /bin/rm -f /swapfile.tmp
# /bin/dd if=/dev/zero of=/swapfile.tmp bs=16m seek=1k count=0
# /sbin/mdconfig -a -t vnode -u 0 -f /swapfile.tmp || /bin/sh
# /bin/chflags nodump /swapfile.tmp
# /bin/rm -f /swapfile.tmp
# /sbin/swapctl -a /dev/md0

This makes the system use a disk-backed dynamic
swap file. If the swap won't be used, no space will
be occupied or reserved on the SSD.

You can also think about changing stuff you won't
need to store on the SSD, maybe some content of /tmp
or /var. You can also put those into a memory disk.

The SSD rule is: Minimize writes if you can. This is
a _general_ rule and does not correspond to swap only!





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
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: swap partition leads to instability?

2013-05-26 Thread Eduardo Morras
On Sun, 26 May 2013 01:58:32 -0700 (PDT)
M. V. bored_to_deat...@yahoo.com wrote:

 hi everyone,
 
 I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive. it's 
 partitioned as normal (/ , /tmp, /var , /usr and swap) for a long time now. 
 But recently I heard from a FreeBSD expert that I shouldn't have swap 
 partition for my server, and having swap partition could make my server 
 unstable. this was so strange for me, and I searched a lot but couldn't find 
 a reason for this claim.
 
 
 so my question is simple:
 - could having a swap partition, be a bad thing for my FreeBSD server? and 
 if so, why and in what conditions?

I never had a problem with swap partitions, but perhaps the FreeBSD expert may 
refer to one of this three issues I can think about problems with swap, none of 
them are unstability issues:

a) Swap partitions may store info from previous boot, you can use swap 
encryption for that.
b) When using swap files (mounting a swap in a file), at shutdown sometimes 
there's a race condition and swap is unmounted before it's empty.
c) If your system needs to use swap, network apps may show/throw timeouts when 
swap i/o is heavy.

Sometimes b) kicks me but it's my fault because i don't shutdown process 
properly.

 
 Cheers!

L

---   ---
Eduardo Morras emorr...@yahoo.es
___
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: swap partition leads to instability?

2013-05-26 Thread Erich Dollansky
Hi,

sorry for my English. Here is what I wanted to say.

On Sun, 26 May 2013 16:09:06 +0700
Erich Dollansky erichsfreebsdl...@alogt.com wrote:

 Hi,
 
 On Sun, 26 May 2013 01:58:32 -0700 (PDT)
 M. V. bored_to_deat...@yahoo.com wrote:
 
  I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD
  drive. it's partitioned as normal (/ , /tmp, /var , /usr and swap)
  for a long time now. But recently I heard from a FreeBSD expert
  that I shouldn't have swap partition for my server, and having swap
  partition could make my server unstable. this was so strange for me,
  and I searched a lot but couldn't find a reason for this claim.
  
 because it is a false claim. I never ever have had any system with
 working hard, that gave a problem because of the swap space.

I never ever have had any system which was working hard that gave
problems because of the swaps space.

Erich
 
 Erich
 ___
 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


Re: swap partition leads to instability?

2013-05-26 Thread Matthew Seaman
On 26/05/2013 09:58, M. V. wrote:
 hi everyone,
 
 I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive. it's 
 partitioned as normal (/ , /tmp, /var , /usr and swap) for a long time now. 
 But recently I heard from a FreeBSD expert that I shouldn't have swap 
 partition for my server, and having swap partition could make my server 
 unstable. this was so strange for me, and I searched a lot but couldn't find 
 a reason for this claim.
 
 
 so my question is simple:
 - could having a swap partition, be a bad thing for my FreeBSD server? and 
 if so, why and in what conditions?

Having a swap partition is absolutely standard for server or workstation
class machines, and should be implemented as a matter of course.  Even
if the machine has much more memory than it would generally ever use and
so have no actual need to swap.

About the only circumstances where you wouldn't want swap is if you were
creating an embedded appliance and eg. didn't have any writable disk
space.  That's pretty extraordinary and as such a system would have to
be heavily customized over stock FreeBSD anyhow, so not having swap
would fade into insignificance compared to the other changes that would
be required.

Why is swap needed?  Nowadays, memory is sufficiently cheap and system
boards are capable of loading so much of it, that the only sensible
strategy is to have more physical RAM than is required to keep your
normal application load working.  So a swap partition should not be
routinely involved in swapping memory pages back and forth.

Even so, idle pages can be swapped out -- there's no point in having an
unreferenced memory page sitting in RAM taking up space that could be
used productively by an active process.  A small amount of swap usage
like this is standard.  A large amount of swap usage like this indicates
you need to switch to using better written software.

Swap is also useful to buffer against unexpected spikes in memory usage.
 Sure, performance generally nosedives once a system starts actively
swapping, but that may be a better outcome than the alternative if there
is no swap capacity available: which is for the kernel to start killing
off processes in an attempt to reduce memory pressure.

Finally, swap is used as the place to record kernel state in the event
of system crashes.  You could use any otherwise unused disk partition
for that, but swap is traditional.  This is where the hoary old recipe
of 'swap = twice ram' came from, although nowadays what with minidumps
and the generally larger amounts of RAM in use you don't need to provide
anything like as much as that.

If you're bothered by having a few GiB of disk allocated as swap but
basically idle, then look into tmpfs or mdmfs for /tmp -- that will let
you make productive use the space while still keeping the ability to
save crashdumps if needed.

Some caveats about where to put a swap area:

   * If your system is under memory pressure, then your swap area can be
extremely active.  In these circumstances putting swap on a SSD card or
other device with a limited number of write-cycles is not a good choice.

   * If you are using ZFS, and again, if you are under memory pressure,
then putting swap on a ZFS can lead to a deadlock where the system needs
to allocate more memory to deal with an out-of-memory condition.  In
this case, it is recommended to create a separate swap partition not
managed by ZFS.

Otherwise, swap can go anywhere.  A dedicated partition will give better
performance than swapping to a file, but file-backed swap is handy if
you need to add swap in a hurry.

For resilience, mirror swap partitions in pairs -- gmirror(8) is a good
tool for that.  Don't try using any of the higher RAID levels for swap
areas -- their performance characteristics are not a good match to the
sort of IO a swap area does.

For best performance, you should spread swap areas over as many disk
spindles as possible.  You can create numerous swap areas and the system
will automatically stripe any IO across them.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature


Re: swap partition leads to instability?

2013-05-26 Thread jb
M. V. bored_to_death85 at yahoo.com writes:

 
 hi everyone,
 
 I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive. it's
partitioned as normal (/ , /tmp,
 /var , /usr and swap) for a long time now. But recently I heard from a
FreeBSD expert that I shouldn't have
 swap partition for my server, and having swap partition could make my
server unstable. this was so strange
 for me, and I searched a lot but couldn't find a reason for this claim.
 
 so my question is simple:
 - could having a swap partition, be a bad thing for my FreeBSD server?
and if so, why and in what conditions?
 
 Cheers!

Hi,

I think your FB expert was up to something. I bet he spoke out of experience.

Swapping by itself can decrease system reliability due to possible data
corruption on swap disk or during two-way transfers, with subsequent incorrect 
RAM and machine crash.

But, swapping is also a symptom, not a problem.
It is never a good idea to let it get to that point.
Badly written, architected, or tuned server app or system are the reason.
Think of RDBMS/SQL server processing real-time on-line transactions and how 
much it goes into setting it up properly for a heavy use.
On a smaller scale, consider this example:
http://blog.jcole.us/2010/09/28/mysql-swap-insanity-and-the-numa-architecture/

jb


___
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: swap partition leads to instability?

2013-05-26 Thread Michael Sierchio
The Intel SLC mSATA drives I use in embedded devices don't support TRIM,
but - it doesn't seem to matter.  Actually, I'm confident that just using
bare partitions for swap is fine, and I haven't had any of the trouble I
witnessed with MLC devices.  The difference is that the size is limited to
under 32GB.

- M


On Sun, May 26, 2013 at 4:32 PM, Warren Block wbl...@wonkity.com wrote:

 On Sun, 26 May 2013, Polytropon wrote:

  On Sun, 26 May 2013 16:09:06 +0700, Erich Dollansky wrote:

 Hi,

 On Sun, 26 May 2013 01:58:32 -0700 (PDT)
 M. V. bored_to_deat...@yahoo.com wrote:

  I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive.
 it's partitioned as normal (/ , /tmp, /var , /usr and swap) for a
 long time now. But recently I heard from a FreeBSD expert that I
 shouldn't have swap partition for my server, and having swap
 partition could make my server unstable. this was so strange for me,
 and I searched a lot but couldn't find a reason for this claim.

  because it is a false claim. I never ever have had any system with
 working hard, that gave a problem because of the swap space.


 I think the problem here is that he's using a SSD.
 As soon as the swap partition is being in heavy use,
 which means it receives many writes, this may lead
 to the SSD wearing out, decreasing its lifetime.


 Another problem with SSDs is that they can have difficulty with wear
 leveling.  This is even worse with swap because there is no way to use TRIM
 to tell the SSD about blocks that have been freed.

 The workaround is a swapfile on UFS with TRIM enabled.  It works fine, and
 even better when you update the rc scripts for shutdown.

 Here's an article on setup:
 http://www.wonkity.com/~**wblock/docs/html/ssd.htmlhttp://www.wonkity.com/~wblock/docs/html/ssd.html

 And here is the PR with a patch:
 http://www.freebsd.org/cgi/**query-pr.cgi?pr=bin/168544http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/168544

 __**_
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/**mailman/listinfo/freebsd-**questionshttp://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-**
 unsubscr...@freebsd.org 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


Re: swap partition leads to instability?

2013-05-26 Thread Warren Block

On Sun, 26 May 2013, Polytropon wrote:


On Sun, 26 May 2013 16:09:06 +0700, Erich Dollansky wrote:

Hi,

On Sun, 26 May 2013 01:58:32 -0700 (PDT)
M. V. bored_to_deat...@yahoo.com wrote:


I have a 24/7 network server/gateway with FreeBSD-8.2 on a SSD drive.
it's partitioned as normal (/ , /tmp, /var , /usr and swap) for a
long time now. But recently I heard from a FreeBSD expert that I
shouldn't have swap partition for my server, and having swap
partition could make my server unstable. this was so strange for me,
and I searched a lot but couldn't find a reason for this claim.


because it is a false claim. I never ever have had any system with
working hard, that gave a problem because of the swap space.


I think the problem here is that he's using a SSD.
As soon as the swap partition is being in heavy use,
which means it receives many writes, this may lead
to the SSD wearing out, decreasing its lifetime.


Another problem with SSDs is that they can have difficulty with wear 
leveling.  This is even worse with swap because there is no way to use 
TRIM to tell the SSD about blocks that have been freed.


The workaround is a swapfile on UFS with TRIM enabled.  It works fine, 
and even better when you update the rc scripts for shutdown.


Here's an article on setup:
http://www.wonkity.com/~wblock/docs/html/ssd.html

And here is the PR with a patch:
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/168544
___
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: swap partition leads to instability?

2013-05-26 Thread Adam Vande More
On Sun, May 26, 2013 at 6:32 PM, Warren Block wbl...@wonkity.com wrote:

 Another problem with SSDs is that they can have difficulty with wear
 leveling.  This is even worse with swap because there is no way to use TRIM
 to tell the SSD about blocks that have been freed.

Um, that is wrong.  It is in fact the basically the point of TRIM.
And SSD's typically use the best form of wear leveling and it's
usually advisable to leave a bit of the drive unpartitioned/unused to
ensure the wear leveling works optimally.



--
Adam Vande More
___
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: swap partition leads to instability?

2013-05-26 Thread Warren Block

On Sun, 26 May 2013, Adam Vande More wrote:


On Sun, May 26, 2013 at 6:32 PM, Warren Block wbl...@wonkity.com wrote:


Another problem with SSDs is that they can have difficulty with wear
leveling.  This is even worse with swap because there is no way to use TRIM
to tell the SSD about blocks that have been freed.


Um, that is wrong.


Which part?  A FreeBSD swap partition has no way to use TRIM, so I 
suggest using a swap file on top of UFS, which does support TRIM.



It is in fact the basically the point of TRIM.
And SSD's typically use the best form of wear leveling and it's
usually advisable to leave a bit of the drive unpartitioned/unused to
ensure the wear leveling works optimally.


Using TRIM should preserve performance better than leaving unused space 
and letting the drive wear leveling algorithm move data around without 
the hint.

___
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: swap partition leads to instability?

2013-05-26 Thread Adam Vande More
On Sun, May 26, 2013 at 7:20 PM, Warren Block wbl...@wonkity.com wrote:
 Which part?

This part:  Another problem with SSDs is that they can have
difficulty with wear leveling.  Do as I suggested and you'll get
maximum life from the drive even with swap present.  Even absent of
best practices, SSD's in general do a great job in managing wear
leveling.  We're 5+ years out from crappy SSD's with dynamic wear
leveling.  Modern SSD's don't suffer nearly the write amplification
effect of earlier drives.  Also the write amplification effect only
comes into play during random writes.  A lot of common swap usage
isn't random.  All this is of course assuming we're dealing with a
quality drive.  If you're using a cheap Chinese knock off, all bets
are off.

 A FreeBSD swap partition has no way to use TRIM, so I suggest
 using a swap file on top of UFS, which does support TRIM.

 Using TRIM should preserve performance better than leaving unused space and
 letting the drive wear leveling algorithm move data around without the hint.

Normal dynamic wear leveling on a modern SSD will be better than
imposing an FS- backed swap for 4GB partion occupying a small fraction
of total drive space.  File backed paging imposes two sets of
bottlenecks and TRIM only *helps* with one.  Another part of the
equation is how much is swap used.  If rarely, this is a non-issue to
begin with.  If it's significant, any flash SSD probably isn't
appropriate.  Certain other SSD's are not subject to these guidelines
at all.

--
Adam Vande More
___
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: Swap files and panics

2012-05-30 Thread Derek Ragona

At 10:54 AM 5/29/2012, Warren Block wrote:
Recently I rearranged partitions on an SSD.  The swap partition was 
eliminated in favor of a swap file on /usr.  This works, allows TRIM 
support on the swap space, and is easier to resize than a partition.


However, sometimes the system panics on shutdown.  It happens after 
syncing disks, so the filesystems are fine, but it's disconcerting.


I suspect but haven't yet managed to prove that it's only when swap is not 
empty.  A race condition involving when the filesystems are unmounted?  Or 
should there be some code in /etc/rc.d/addswap to run swapoff before shutdown?


This is on a very recent 9-STABLE amd64, i5 2500K.

rc.conf:
swapfile=/usr/swap/swap



Did you remove the old swap file entry from /etc/fstab?

-Derek

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
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: swap space

2012-02-17 Thread Mike Tancsa
On 2/17/2012 6:54 PM, Jim Pazarena wrote:
 is there a command which can show the size of the hard drive swap?
 

% pstat -T
438/12328 files
98M/10240M swap space

---Mike

-- 
---
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, m...@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/
___
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: swap space

2012-02-17 Thread Chuck Swiger
On Feb 17, 2012, at 3:54 PM, Jim Pazarena wrote:
 is there a command which can show the size of the hard drive swap?
 
 A df seems to avoid the swap area.

You're looking for swapinfo

Regards,
-- 
-Chuck

___
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: swap space

2012-02-17 Thread Jonathan Vomacka
On Feb 17, 2012 6:55 PM, Jim Pazarena fqu...@paz.bz wrote:

 is there a command which can show the size of the hard drive swap?

 A df seems to avoid the swap area.

 This would be on a live production server.
 Thanks.
 ___
 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

Top or vmstat
___
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: swap space

2012-02-17 Thread Robison, Dave

On 02/17/2012 15:58, Chuck Swiger wrote:

On Feb 17, 2012, at 3:54 PM, Jim Pazarena wrote:

is there a command which can show the size of the hard drive swap?

A df seems to avoid the swap area.

You're looking for swapinfo

Regards,


Chuck beat me to it.

swapinfo or top are the two ways I normally check.



--
Dave Robison
Sales Solution Architect II
FIS Banking Solutions
510/621-2089 (w)
530/518-5194 (c)
510/621-2020 (f)
da...@vicor.com
david.robi...@fisglobal.com

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: swap space

2012-02-17 Thread Devin Teske


 -Original Message-
 From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-
 questi...@freebsd.org] On Behalf Of Robison, Dave
 Sent: Friday, February 17, 2012 4:11 PM
 To: freebsd-questions@freebsd.org
 Subject: Re: swap space
 
 On 02/17/2012 15:58, Chuck Swiger wrote:
  On Feb 17, 2012, at 3:54 PM, Jim Pazarena wrote:
  is there a command which can show the size of the hard drive swap?
 
  A df seems to avoid the swap area.
  You're looking for swapinfo
 
  Regards,
 
 Chuck beat me to it.
 
 swapinfo or top are the two ways I normally check.
 

I'm digging the fact that it now accepts -h to produce human-readable sizes.

swapinfo didn't always support -h
-- 
Devin

_
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
___
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: swap space

2012-02-17 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Fri Feb 17 17:59:50 2012
 Date: Fri, 17 Feb 2012 15:54:18 -0800
 From: Jim Pazarena fqu...@paz.bz
 To: FreeBSD Mailing List freebsd-questions@freebsd.org
 Subject: swap space

 is there a command which can show the size of the hard drive swap?

 A df seems to avoid the swap area.

That *is* expected behavior.
  
'df' shows utilization of -filesystems-.  'swap' is not filesystem.

 This would be on a live production server.

The traditional means is 'pstat -s'.  On relatively modern systems,
'swapinfo' is an alias.

___
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: Swap Space

2011-01-06 Thread Matthew Seaman
On 05/01/2011 22:33, Jeff Whitman wrote:
 I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
 others say stay with 2 x RAM.

Standard advice is 2x RAM -- but that dates back to the days when
servers would have quantities of RAM measured in Megabytes rather than
Gigabytes.

2 X RAM is a lot of disk space nowadays -- so either you'll need to find
some other use for that space; eg. as a swap-backed /tmp partition,
or else provide less swap.  Also, there's a maximum of -- I think -- 8GB
swap above which the performance of swap is degraded, due to algorithmic
limits in the way memory pages are mapped onto disk pages.

You need 1 x RAM + a few kB in order to support getting a crashdump. Or
at least, you did before the days of minidumps.  Not sure what the
requirements are for getting system dumps nowadays.  Swap space used for
crashdumps should be a raw partition, not a file.

On the other hand, for good performance you should not be using any
significant amounts of swap in normal usage.  You will need some swap,
as the OS tends to use a small amount even when not under memory
pressure.  You should have swap to act as a buffer in case your machine
suddenly starts using up more memory than you expect, either because of
memory leaks, or due to demand spikes or through any number of other
possible causes.

Therefore, I think the best advice for a modern large memory system
would be:

If RAM  8GB, then SWAP = 8GB[*]
If RAM  8GB, then SWAP = 1 x RAM + delta

where delta is perhaps a Megabyte or so.  Just rounding the partition
size up to the next cylinder boundary should be enough (which happens
automatically with most partitioning schemes).

Cheers,

Matthew

[*] In this case, if you need crashdumps, you should dedicate another
otherwise unused partition of the correct size as your dumpdev.

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Swap Space

2011-01-06 Thread Jerry McAllister
On Thu, Jan 06, 2011 at 09:42:36AM +, Matthew Seaman wrote:

 On 05/01/2011 22:33, Jeff Whitman wrote:
  I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
  others say stay with 2 x RAM.
 
 Standard advice is 2x RAM -- but that dates back to the days when
 servers would have quantities of RAM measured in Megabytes rather than
 Gigabytes.

Of course, in those days disk space was measured in MBytes too.
 
 Also, there's a maximum of -- I think -- 8GB
 swap above which the performance of swap is degraded, due to algorithmic
 limits in the way memory pages are mapped onto disk pages.

I don't know about an 8GB limit for swap performance.  I suppose
it is possible.So, the following formula from Mathew is probably 
a good new rule of thumb.

 
 You need 1 x RAM + a few kB in order to support getting a crashdump. Or
 at least, you did before the days of minidumps.  Not sure what the
 requirements are for getting system dumps nowadays.  Swap space used for
 crashdumps should be a raw partition, not a file.

jerry


 
 On the other hand, for good performance you should not be using any
 significant amounts of swap in normal usage.  You will need some swap,
 as the OS tends to use a small amount even when not under memory
 pressure.  You should have swap to act as a buffer in case your machine
 suddenly starts using up more memory than you expect, either because of
 memory leaks, or due to demand spikes or through any number of other
 possible causes.
 
 Therefore, I think the best advice for a modern large memory system
 would be:
 
 If RAM  8GB, then SWAP = 8GB[*]
 If RAM  8GB, then SWAP = 1 x RAM + delta
 
 where delta is perhaps a Megabyte or so.  Just rounding the partition
 size up to the next cylinder boundary should be enough (which happens
 automatically with most partitioning schemes).
 
   Cheers,
 
   Matthew
 
 [*] In this case, if you need crashdumps, you should dedicate another
 otherwise unused partition of the correct size as your dumpdev.
 
 -- 
 Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
   Flat 3
 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
 


___
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: Swap Space

2011-01-05 Thread Adam Vande More
On Wed, Jan 5, 2011 at 4:33 PM, Jeff Whitman jwhit...@jwnetsource.comwrote:

 I will be installing 8.1 on a Dell Poweredge 2850, with dual 3 GHz XEON
 processors and 6GB RAM.

 What is the recommended swap space?


 I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
 others say stay with 2 x RAM.


Definitely not 0, but 2x would probably be way too much IMO. 4 - 6 GB should
be enough for most use cases.


-- 
Adam Vande More
___
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: Swap Space

2011-01-05 Thread Gary Gatten

 I will be installing 8.1 on a Dell Poweredge 2850, with dual 3 GHz XEON
 processors and 6GB RAM.

 What is the recommended swap space?


 I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
 others say stay with 2 x RAM.


Definitely not 0, but 2x would probably be way too much IMO. 4 - 6 GB should
be enough for most use cases.


Correct me if I'm wrong, but if necessary one could add (and activate) a 
secondary / additional swap file if necessary without rebooting.  So maybe 
start with a few gig and add an additional swap file if necessary?





font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system.
/font

___
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: Swap Space

2011-01-05 Thread Bruce Cran
On Wed, 5 Jan 2011 17:20:48 -0600
Gary Gatten ggat...@waddell.com wrote:

 Correct me if I'm wrong, but if necessary one could add (and
 activate) a secondary / additional swap file if necessary without
 rebooting.  So maybe start with a few gig and add an additional swap
 file if necessary?

Swapping to a file is really slow and should only be done if absolutely
necessary since every read/write has to go through the filesystem code
which it doesn't do if done via a swap slice.

-- 
Bruce Cran
___
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: Swap Space

2011-01-05 Thread Gary Gatten

 Correct me if I'm wrong, but if necessary one could add (and
 activate) a secondary / additional swap file if necessary without
 rebooting.  So maybe start with a few gig and add an additional swap
 file if necessary?

Swapping to a file is really slow and should only be done if absolutely
necessary since every read/write has to go through the filesystem code
which it doesn't do if done via a swap slice.

Good point.  It's been several years and back on v5 or 6 when I did something 
like this.  If there's unpartitioned space on the drive, can one add a 
secondary swap partition real-time?  I forget what I did here - I'm sure I 
followed what's in the handbook re swap space.  Probably did a swap file...





font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system.
/font

___
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: Swap Space

2011-01-05 Thread Adam Vande More
On Wed, Jan 5, 2011 at 5:33 PM, Gary Gatten ggat...@waddell.com wrote:


  Correct me if I'm wrong, but if necessary one could add (and
  activate) a secondary / additional swap file if necessary without
  rebooting.  So maybe start with a few gig and add an additional swap
  file if necessary?

 Swapping to a file is really slow and should only be done if absolutely
 necessary since every read/write has to go through the filesystem code
 which it doesn't do if done via a swap slice.

 Good point.  It's been several years and back on v5 or 6 when I did
 something like this.  If there's unpartitioned space on the drive, can one
 add a secondary swap partition real-time?  I forget what I did here - I'm
 sure I followed what's in the handbook re swap space.  Probably did a swap
 file...


 Yes you can do that with swapon(1)

It's been said though that FreeBSD memory paging algorithms take into
account the system's entire available VM for deciding on when to act in low
memory conditions and these parameters are tuned expect some of that to be
swap space.  That is why one reason there *should* be a least some swap
space even on a system w/ plenty of RAM.



-- 
Adam Vande More
___
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: Swap Space - hijack?

2011-01-05 Thread Gary Gatten
 Correct me if I'm wrong, but if necessary one could add (and
 activate) a secondary / additional swap file if necessary without
 rebooting.  So maybe start with a few gig and add an additional swap
 file if necessary?

Swapping to a file is really slow and should only be done if absolutely
necessary since every read/write has to go through the filesystem code
which it doesn't do if done via a swap slice.
Good point.  It's been several years and back on v5 or 6 when I did something 
like this.  If there's unpartitioned space on the drive, can one add a 
secondary swap partition real-time?  I forget what I did here - I'm sure I 
followed what's in the handbook re swap space.  Probably did a swap file...

 Yes you can do that with swapon(1)

It's been said though that FreeBSD memory paging algorithms take into account 
the system's entire available VM for deciding on when to act in low memory 
conditions and these parameters are tuned expect some of that to be swap space. 
 That is why one reason there *should* be a least some swap space even on a 
system w/ plenty of RAM.

Sorry for the probable hijack... Speaking of swapping algorithms, is there a 
way to force a parent and all child processes to NOT be swapped - period - and 
always remain 100% in real memory?  And if so, is it discouraged or 
completely up to the sysadmin?







font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system.
/font

___
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: Swap Space

2011-01-05 Thread Robert Huff
Adam Vande More writes:

   I will be installing 8.1 on a Dell Poweredge 2850, with dual 3 GHz XEON
   processors and 6GB RAM.
  
   What is the recommended swap space?

   I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
   others say stay with 2 x RAM.
  
  
  Definitely not 0, but 2x would probably be way too much IMO. 4 -
  6 GB should be enough for most use cases.

One data point:

last pid: 58457;  load averages:  1.91,  2.20,  2.27  up 8+19:16:27 18:51:23
166 processes: 5 running, 158 sleeping, 2 stopped, 1 zombie

Mem: 1541M Active, 1267M Inact, 1223M Wired, 195M Cache, 802M Buf, 3440M Free
Swap: 18G Total, 11M Used, 18G Free

(That's 8g total memory.)  It's a fairly lightly loaded
workstation.
A philosophical consideration: modern disks are cheap, and
fairly fast.  Repartitioning if you don't have enough is a pain.


Robert Huff

___
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: Swap Space

2011-01-05 Thread Robison, Dave

On 01/05/11 15:20, Gary Gatten wrote:

I will be installing 8.1 on a Dell Poweredge 2850, with dual 3 GHz XEON
processors and 6GB RAM.

What is the recommended swap space?


I'm finding conflicting data on this.  Some say 0, some say 1 times RAM,
others say stay with 2 x RAM.


Definitely not 0, but 2x would probably be way too much IMO. 4 - 6 GB should
be enough for most use cases.


Correct me if I'm wrong, but if necessary one could add (and activate) a 
secondary / additional swap file if necessary without rebooting.  So maybe 
start with a few gig and add an additional swap file if necessary?





font size=1
div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 
1.0pt 0in'
/div
This email is intended to be reviewed by only the intended recipient
  and may contain information that is privileged and/or confidential.
  If you are not the intended recipient, you are hereby notified that
  any review, use, dissemination, disclosure or copying of this email
  and its attachments, if any, is strictly prohibited.  If you have
  received this email in error, please immediately notify the sender by
  return email and delete this email from your system.
/font

___
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




yep

man swapon

though this won't be as elegant as having it set up as normal swap


--
Dave Robison
Sales Solution Architect II
FIS Banking Solutions
510/621-2089 (w)
530/518-5194 (c)
510/621-2020 (f)
da...@vicor.com
david.robi...@fisglobal.com

_

The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
_
___
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: swap pager:indefinite wait buffer: message out of vm.c

2010-12-02 Thread Benjamin Lee
On 12/01/2010 03:23 PM, Mark Terribile wrote:
 
 Hi,
 
 Would some kind soul please tell me the meaning of a message coming
 from vm.c (FreeBSD 7.2):
 swap pager: indefinite wait buffer: bufobj: 0, blkno: 2, size: 4096
 
 This message occurs after a return from an msleep whose last args are PSWP,
 swread, and HZ*20 .
 
 When it occurs, some interactive program is locked up.  It recovers
 sometime later.
 
 My best guess is that this is a complaint that swap or paging I/O has been
 excessively delayed.  It is occurring while I am running disk-to-disk
 transfers that have deep buffering.  Think mbuf(1), but it's my own code,
 testing some algorithms.  I speculate that if the disk queuing/head movement 
 optimization doesn't let the heads move off the file system
 where the file resides (and I only see this with large, single files)
 then this problem might result.  But that is a guess, and speculation.
 
 Does anyone know if this can occur under later versions of FreeBSD?

Hi Mark,

Do you have any test cases that reliably reproduce the problem?  I've
seen it crop up very infrequently on 8.1-RELEASE but I haven't been able
to reproduce it.


-- 
Benjamin Lee
http://www.b1c1l1.com/



signature.asc
Description: OpenPGP digital signature


Re: Swap on ZFS

2010-10-08 Thread krad
On 7 October 2010 21:20, Anselm Strauss amsiba...@gmail.com wrote:

 On 10/02/10 17:52, Adam Vande More wrote:
  On Sat, Oct 2, 2010 at 4:30 AM, Anselm Strauss amsiba...@gmail.com
 wrote:
 
  Hi
 
  I have a virtual server with only 512 MB of memory but still want to run
  ZFS on it.
  snip
  Has there been any fix or workaround for this? I guess it does not help
  when I use a swap file on ZFS instead of a separate zvol.
 
 
  Make sure you are following this:
  http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot  Please note swap is not a
  ZVOL, it is a sepate partition.  You'd have the same problem with ZVOL.
  Also use i386, that will save you a bit of memory.  Follow the ZFS tuning
  guide.  Even if you follow all those things, I'm not sure you'll be able
 to
  get it stable.  512MB is really tight.
 

 I now have the swap on a separate disk and it seems more stable.
 Although the server still has only 512 MB of RAM, runs on amd64 and I
 did no tuning. It's not a file server but compiling ports and running
 some services seems okay.

 I have seen multiple posts on the net where people put swap on ZFS. What
 sense does it make when every time the machine runs out of physical
 memory it freezes before it can allocate some swap memory. Does it only
 make sense in case you have additional non-ZFS swap?
 ___
 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



there must be some logic in is as when you build a (open)*solaris box on
zfs, the swap is on a vdev by defaukt. I think its because ZFS runs in
kernel memory and this isn't swapable. Please correct me if im wrong
somebody.


$ swap -lh
swapfile devswaplo   blocks free
/dev/zvol/dsk/rpool/swap 182,24K 2.0G 2.0G
$ uname -a
SunOS desktop2 5.11 snv_134 i86pc i386 i86pc Solaris
___
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: Swap on ZFS

2010-10-07 Thread Anselm Strauss
On 10/02/10 17:52, Adam Vande More wrote:
 On Sat, Oct 2, 2010 at 4:30 AM, Anselm Strauss amsiba...@gmail.com wrote:
 
 Hi

 I have a virtual server with only 512 MB of memory but still want to run
 ZFS on it.
 snip
 Has there been any fix or workaround for this? I guess it does not help
 when I use a swap file on ZFS instead of a separate zvol.

 
 Make sure you are following this:
 http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot  Please note swap is not a
 ZVOL, it is a sepate partition.  You'd have the same problem with ZVOL.
 Also use i386, that will save you a bit of memory.  Follow the ZFS tuning
 guide.  Even if you follow all those things, I'm not sure you'll be able to
 get it stable.  512MB is really tight.
 

I now have the swap on a separate disk and it seems more stable.
Although the server still has only 512 MB of RAM, runs on amd64 and I
did no tuning. It's not a file server but compiling ports and running
some services seems okay.

I have seen multiple posts on the net where people put swap on ZFS. What
sense does it make when every time the machine runs out of physical
memory it freezes before it can allocate some swap memory. Does it only
make sense in case you have additional non-ZFS swap?
___
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: Swap on ZFS

2010-10-02 Thread Adam Vande More
On Sat, Oct 2, 2010 at 4:30 AM, Anselm Strauss amsiba...@gmail.com wrote:

 Hi

 I have a virtual server with only 512 MB of memory but still want to run
 ZFS on it.
 snip
 Has there been any fix or workaround for this? I guess it does not help
 when I use a swap file on ZFS instead of a separate zvol.


Make sure you are following this:
http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot  Please note swap is not a
ZVOL, it is a sepate partition.  You'd have the same problem with ZVOL.
Also use i386, that will save you a bit of memory.  Follow the ZFS tuning
guide.  Even if you follow all those things, I'm not sure you'll be able to
get it stable.  512MB is really tight.

-- 
Adam Vande More
___
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: Swap Partition First?

2010-02-02 Thread Martin McCormick
I figured out a way to install swap as the only
fixed-sized partition such that whatever is left is marked as
BSD (165) but I am not sure if this is a workable solution so I
am asking for suggestions.

If I set up the disk label reference file as follows:

# /dev/ad0s1:
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a: *  20971524.2BSD 2048 16384 28552 
  b:  20971520  swap

bsdlabel gets very confused and one ends up with possibly swap
and about 4 gigabytes of FreeBSD which is not right.

So, I inverted things since what we want is for
everything but swap to be FreeBSD and we want this to work on
some disk for which we may not know the size.

# /dev/ad0s1:
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a:  20971520  swap
  b: *  20971524.2BSD 2048 16384 28552 

This means one mounts ad0s1b instead of ad0s1a which is
what you normally see. Will this create some sort of monster
later down the line?

The hope is to create a largely automated process that
coworkers can use if we ever need to recreate X or Y server from
a new piece of hardware during an upgrade or after a lightening
storm when every minute counts. Many thanks.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Telecommunications Services Group
___
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: Swap Partition First?

2010-02-02 Thread Jerry McAllister
On Tue, Feb 02, 2010 at 11:28:13AM -0600, Martin McCormick wrote:

   I figured out a way to install swap as the only
 fixed-sized partition such that whatever is left is marked as
 BSD (165) but I am not sure if this is a workable solution so I
 am asking for suggestions.
 
   If I set up the disk label reference file as follows:
 
 # /dev/ad0s1:
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
   a: *  20971524.2BSD 2048 16384 28552 
   b:  20971520  swap
 
 bsdlabel gets very confused and one ends up with possibly swap
 and about 4 gigabytes of FreeBSD which is not right.

This could be a problem.   I think using the '*' for size will 
cause it to use the whole remaining space for that partition.
Even though it logically starts at 2097152, it might not come out
even on a good boundary or something like that.  It really seems to
like to have things entered sequentially.

 
   So, I inverted things since what we want is for
 everything but swap to be FreeBSD and we want this to work on
 some disk for which we may not know the size.
 
 # /dev/ad0s1:
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
   a:  20971520  swap
   b: *  20971524.2BSD 2048 16384 28552 
 
   This means one mounts ad0s1b instead of ad0s1a which is
 what you normally see. Will this create some sort of monster
 later down the line?

It should not create a problem in the system, but it might 
introduce some confusion later when you have partly forgotten
what you did and why.   So, you might want to keep the swap
on 'b' since it is a strong convention.

You could have left the 'a' partition empty; just not used it.
Then make 'b' your swap with the fixed size as usual and then 
something like 'd' (or 'e' or 'f' or 'g' or 'h') be that large 
partition using up all the rest of the space.

Although it seems to prefer the space be claimed in order, it 
has no problem ignoring skipped partition letters.

If I use up a who extra disk in one slice-partition, I usually 
make it 'd' or 'h' and skip 'a', 'b' (and of course, 'c') just to 
keep things clear in my head.

Something like:

# /dev/ad0s1:
  8 partitions:
  #sizeoffsetfstype   [fsize bsize bps/cpg]
b:  2097152 0  swap
g:* *4.2BSD 2048 16384 28552
 
Should work just fine.

 
   The hope is to create a largely automated process that
 coworkers can use if we ever need to recreate X or Y server from
 a new piece of hardware during an upgrade or after a lightening
 storm when every minute counts. Many thanks.

So, in that case, do stick closer to convention and use a higher 
partition label identifier such as 'd' or whatever, as above.   
In fact set yourself up with a conventional use for each identifier
so that it can be used in all circumstances.  Such as:

   a = root(if the disk doesn't have root skip 'a')
   b = swap(''  ''  ''   ''  ''  swap  ''  'b')
   c = reserved for system
   d = /tmp(  etc )
   e = /usr(  etc )
   f = /var(  etc )
   g = /home   (  etc )
   h = /work   extra big space to put stuff.  ( etc   )

Just use the ones needed and skip the others.   But still enter 
the ones you use in their conventional order in bsdlabel.

jerry
 
 Martin McCormick WB5AGZ  Stillwater, OK 
 Systems Engineer
 OSU Information Technology Department Telecommunications Services Group
 ___
 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


Re: Swap Partition First?

2010-02-02 Thread Martin McCormick
Jerry McAllister writes:
 This could be a problem.   I think using the '*' for size will
 cause it to use the whole remaining space for that partition.
 Even though it logically starts at 2097152, it might not come out
 even on a good boundary or something like that.  It really seems to
 like to have things entered sequentially.

 It should not create a problem in the system, but it might
 introduce some confusion later when you have partly forgotten
 what you did and why.   So, you might want to keep the swap
 on 'b' since it is a strong convention.

Thanks for all the excellent suggestions, here. I may write
a shell script that runs fdisk and captures the number of total
blocks and subtracts from that value the size of swap. That
would make it possible to generate a totally conventional
bsdlabel file in the order we are used to having the partitions
in.

This would just be a part of the script that the person
building the new system would run without having to know
precisely how to format the drive.

Our group has several members who would do just fine in
setting up a system if guided over some of the rough parts by a
good script. The challenge is to come up with something that
does not give someone the rope to hang themselves accidentally.
I am lucky in that I have a couple of old systems to do horrible
things to that are too slow and old for anybody else to need.

Again, thank you.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Telecommunications Services Group
___
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: Swap Partition First? Something is still Wrong.

2010-01-31 Thread Martin McCormick
When referring to the slices in a FreeBSD partition,
which is correct, ad0s1a or ad0s1-1?

One of the problems in setting up install.cfg is that I
am not sure if it is not configuring the disk because the
designations are wrong or if I am telling fdisk to do something
that it can't do.

ad0s1-1=ufs 77116032 / 1
ad0s1-2=swap 0 

or should it be ad0s1a and ad0s1b?

When using ad0s1a and ad0s1b, there are no error
messages, but it also didn't create the swap partition. Thank you.

Martin McCormick
___
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: Swap Partition First?

2010-01-27 Thread Bob Johnson
The only thing that looks out of place is that you have defined
ad0s1-2 before ad0s1-1. I've never tested it, but perhaps this is
causing it to get confused when calculating the disk layout? In other
words, perhaps you should use

#1G swap followed by / on rest of disk.
 #
 ad0s1-1=swap 2097152
 #All the rest is FreeBSD with soft updates.
 ad0s1-2=ufs 0 / 1

so they are defined in numerical sequence.


On 1/27/10, Martin McCormick mar...@dc.cis.okstate.edu wrote:
 Our FreeBSD systems mostly have a very simple disk layout. There
 is a 1 or 2-gigabyte swap partition and all the rest is FreeBSD.
 When manually configuring these partitions in sysinstall, I
 usually set up swap first with a 1GB size and then use the
 remaining  space by selecting the values as defaults.

   An attempt to script this in an install.cfg file is not
 going well. The disk formatting part of the file is as follows:

 disk=ad0
 partition=all
 bootManager=none
 diskPartitionEditor
 #Entire disk is FreeBSD.
 diskPartitionWrite
 

 
 # All sizes are expressed in 512 byte blocks!
 #
 #1G swap followed by / on rest of disk.
 #
 ad0s1-2=swap 2097152
 #All the rest is FreeBSD with soft updates.
 ad0s1-1=ufs 0 / 1
 # Let's do it!
 diskLabelEditor
 diskLabelCommit

 # OK, everything is set.  Do it!
 installCommit

   This doesn't work. sysinstall reports that it can't
 write the swap space.

   fdisk reports a FreeBSD partition and all the others are
 shown as free.

   Any ideas? Thank you.

 Martin McCormick WB5AGZ  Stillwater, OK
 Systems Engineer
 OSU Information Technology Department Telecommunications Services Group
 ___
 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



-- 
-- Bob Johnson
   fbsdli...@gmail.com
___
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: Swap Partition First?

2010-01-27 Thread Martin McCormick
Bob Johnson writes:
 The only thing that looks out of place is that you have defined
 ad0s1-2 before ad0s1-1. I've never tested it, but perhaps this is
 causing it to get confused when calculating the disk layout? In other
 words, perhaps you should use
 
 #1G swap followed by / on rest of disk.

Thank you. I wondered about that. I didn't know how
smart the allocater was. Technically, when I defined ad0s1-1 as
being the rest of the disk, nothing else had been defined yet so
that should mean 100% of the disk. That's called thinking too
much.

Martin McCormick
___
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: Swap and memory optimization

2009-10-02 Thread mojo fms
I would just bump the ram to 2gigs or 4 if it supports it and call it good.
You should be fine.

On Thu, Oct 1, 2009 at 8:58 AM, Bill Moran wmo...@potentialtech.com wrote:

 In response to Dan Nelson dnel...@allantgroup.com:

  In the last episode (Oct 01), Bill Moran said:
   bsd b...@todoo.biz wrote:
I have a FBSD 6.4p7 box that I use as a mail server - 1Go RAM - RAID1
Works quite well.
   
As I plan to put 100 more mail accounts soon on the server I was
wondering if the memory  swap was ok on the server considering these
figures:
   
last pid: 18956;  load averages:  0.04,  0.11,  0.05 up  19+08:36:23
  09:53:38
125 processes: 1 running, 124 sleeping
CPU:  0.0% user,  0.0% nice,  1.5% system,  0.4% interrupt, 98.1%
 idle
Mem: 499M Active, 70M Inact, 362M Wired, 41M Cache, 111M Buf, 20M
 Free
Swap: 2000M Total, 160M Used, 1840M Free, 8% Inuse
   
Though It looks good to me - the server swaps a bit (between 8 to
 14%)
and there is not much memory left.
  
   Looks like the server would run more smoothly with a bit more RAM.  At
   least an additional 256M, I would think, but considering the price of
 RAM,
   you might as well just up it to 2G.
 
  The amount of used swap is much less important than whether you are
 actively
  swapping (if there are In/Out values on the Swap line in top, or if
 vmstat
  1 shows nonzero values in the pi/po columns).  160MB of used swap is
 fine
  if it's just unused daemons (getty, idle webserver, etc).  More memory
 can
  never hurt, but it doesn't seem like it's urgently needed here.

 I don't know about that, Dan.  Especially considering it's a mail server
 he's talking about, there's no RAM left for disk cache on that machine.

 We've seen performance gains on our mail server by putting obscene
 amounts of RAM into it.  After a bit of use, FreeBSD ends up having 6.5G
 of inactive RAM, which I assume is cache of mailboxes.  The result is that
 while watching gstat, the amount of disk reads is very low (since a lot
 of data is already in RAM) and the IO is available to do fast writes when
 new mail comes in.

 --
 Bill Moran
 http://www.potentialtech.com
 http://people.collaborativefusion.com/~wmoran/
  ___
 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




-- 
Who knew
___
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: Swap and memory optimization

2009-10-01 Thread Bill Moran
bsd b...@todoo.biz wrote:

 Hello,
 
 I have a FBSD 6.4p7 box that I use as a mail server - 1Go RAM - RAID1
 Works quite well.
 
 As I plan to put 100 more mail accounts soon on the server I was  
 wondering if the memory  swap was ok on the server considering these  
 figures:
 
 
 last pid: 18956;  load averages:  0.04,  0.11,   
 0.05 
   
   up 
   19+08:36:23  09:53:38
 125 processes: 1 running, 124 sleeping
 CPU:  0.0% user,  0.0% nice,  1.5% system,  0.4% interrupt, 98.1% idle
 Mem: 499M Active, 70M Inact, 362M Wired, 41M Cache, 111M Buf, 20M Free
 Swap: 2000M Total, 160M Used, 1840M Free, 8% Inuse
 
 
 Though It looks good to me - the server swaps a bit (between 8 to 14%)  
 and there is not much memory left.

Looks like the server would run more smoothly with a bit more RAM.  At
least an additional 256M, I would think, but considering the price of
RAM, you might as well just up it to 2G.

-- 
Bill Moran
http://www.potentialtech.com
___
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: Swap and memory optimization

2009-10-01 Thread Jerry McAllister
On Thu, Oct 01, 2009 at 09:58:36AM +0200, bsd wrote:

 Hello,
 
 I have a FBSD 6.4p7 box that I use as a mail server - 1Go RAM - RAID1
 Works quite well.
 
 As I plan to put 100 more mail accounts soon on the server I was  
 wondering if the memory  swap was ok on the server considering these  
 figures:
 
 
 last pid: 18956;  load averages:  0.04,  0.11,   
 0.05 
   
  up 19+08:36:23  09:53:38
 125 processes: 1 running, 124 sleeping
 CPU:  0.0% user,  0.0% nice,  1.5% system,  0.4% interrupt, 98.1% idle
 Mem: 499M Active, 70M Inact, 362M Wired, 41M Cache, 111M Buf, 20M Free
 Swap: 2000M Total, 160M Used, 1840M Free, 8% Inuse
 
 
 Though It looks good to me - the server swaps a bit (between 8 to 14%)  
 and there is not much memory left.
 
 Let me know what you think about these figures.
 

Unless something else is going on or you are running some
commercial server that gets huge amounts of traffic, you
should have no capacity problem with this setup.   You might
want to upgrade to a more recent FreeBSD.

jerry



 
 Thanks.
 
 
 Gregober --- PGP ID -- 0x1BA3C2FD
 bsd @at@ todoo.biz
 
 P Please consider your environmental responsibility before printing  
 this e-mail
 
 ___
 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


Re: Swap and memory optimization

2009-10-01 Thread Dan Nelson
In the last episode (Oct 01), Bill Moran said:
 bsd b...@todoo.biz wrote:
  I have a FBSD 6.4p7 box that I use as a mail server - 1Go RAM - RAID1
  Works quite well.
  
  As I plan to put 100 more mail accounts soon on the server I was
  wondering if the memory  swap was ok on the server considering these
  figures:
  
  last pid: 18956;  load averages:  0.04,  0.11,  0.05 up  19+08:36:23  
  09:53:38
  125 processes: 1 running, 124 sleeping
  CPU:  0.0% user,  0.0% nice,  1.5% system,  0.4% interrupt, 98.1% idle
  Mem: 499M Active, 70M Inact, 362M Wired, 41M Cache, 111M Buf, 20M Free
  Swap: 2000M Total, 160M Used, 1840M Free, 8% Inuse
  
  Though It looks good to me - the server swaps a bit (between 8 to 14%)
  and there is not much memory left.
 
 Looks like the server would run more smoothly with a bit more RAM.  At
 least an additional 256M, I would think, but considering the price of RAM,
 you might as well just up it to 2G.

The amount of used swap is much less important than whether you are actively
swapping (if there are In/Out values on the Swap line in top, or if vmstat
1 shows nonzero values in the pi/po columns).  160MB of used swap is fine
if it's just unused daemons (getty, idle webserver, etc).  More memory can
never hurt, but it doesn't seem like it's urgently needed here.

-- 
Dan Nelson
dnel...@allantgroup.com
___
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: Swap and memory optimization

2009-10-01 Thread Bill Moran
In response to Dan Nelson dnel...@allantgroup.com:

 In the last episode (Oct 01), Bill Moran said:
  bsd b...@todoo.biz wrote:
   I have a FBSD 6.4p7 box that I use as a mail server - 1Go RAM - RAID1
   Works quite well.
   
   As I plan to put 100 more mail accounts soon on the server I was
   wondering if the memory  swap was ok on the server considering these
   figures:
   
   last pid: 18956;  load averages:  0.04,  0.11,  0.05 up  19+08:36:23  
   09:53:38
   125 processes: 1 running, 124 sleeping
   CPU:  0.0% user,  0.0% nice,  1.5% system,  0.4% interrupt, 98.1% idle
   Mem: 499M Active, 70M Inact, 362M Wired, 41M Cache, 111M Buf, 20M Free
   Swap: 2000M Total, 160M Used, 1840M Free, 8% Inuse
   
   Though It looks good to me - the server swaps a bit (between 8 to 14%)
   and there is not much memory left.
  
  Looks like the server would run more smoothly with a bit more RAM.  At
  least an additional 256M, I would think, but considering the price of RAM,
  you might as well just up it to 2G.
 
 The amount of used swap is much less important than whether you are actively
 swapping (if there are In/Out values on the Swap line in top, or if vmstat
 1 shows nonzero values in the pi/po columns).  160MB of used swap is fine
 if it's just unused daemons (getty, idle webserver, etc).  More memory can
 never hurt, but it doesn't seem like it's urgently needed here.

I don't know about that, Dan.  Especially considering it's a mail server
he's talking about, there's no RAM left for disk cache on that machine.

We've seen performance gains on our mail server by putting obscene
amounts of RAM into it.  After a bit of use, FreeBSD ends up having 6.5G
of inactive RAM, which I assume is cache of mailboxes.  The result is that
while watching gstat, the amount of disk reads is very low (since a lot
of data is already in RAM) and the IO is available to do fast writes when
new mail comes in.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/
___
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: Swap on ZFS - still a bad idea?

2009-06-03 Thread Wojciech Puchar

Putting swap on ZFS is listed as broken on the wiki.  Is that still true of
the newly MFC'ed version?


No idea. You may just make separate partition for swapping and it will 
work. Good if you have swap just for sure.


If your system needs swapping under normal operation, using ZFS is really 
bad idea as it needs lots of memory - which you are already short of.


With RAM costs of 20$/GB (DDR2) it's best to get as much memory as your 
software needs.

___
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: Swap on ZFS - still a bad idea?

2009-06-03 Thread Kirk Strauser
On Wednesday 03 June 2009 01:36:37 pm Wojciech Puchar wrote:

 No idea. You may just make separate partition for swapping and it will
 work. Good if you have swap just for sure.

Well, the problem is that I wanted to have a bare-metal ZFS system without 
any FreeBSD slices or partitions.

 If your system needs swapping under normal operation, using ZFS is really
 bad idea as it needs lots of memory - which you are already short of.

It was more of the just in case, with plenty of RAM for normal operation.
-- 
Kirk Strauser
___
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: Swap on ZFS - still a bad idea?

2009-06-03 Thread Wojciech Puchar

On Wednesday 03 June 2009 01:36:37 pm Wojciech Puchar wrote:


No idea. You may just make separate partition for swapping and it will
work. Good if you have swap just for sure.


Well, the problem is that I wanted to have a bare-metal ZFS system without
any FreeBSD slices or partitions.


slices are not needed with any fs.

partitions - you need at least boot partition.




If your system needs swapping under normal operation, using ZFS is really
bad idea as it needs lots of memory - which you are already short of.


It was more of the just in case, with plenty of RAM for normal operation.
--
so just don't set up swap at all, or do under ZFS as it's just in case 
not normal operation

___
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: Swap partition

2008-01-03 Thread Manolis Kiagias



Eugen Udma wrote:

Hello,



I have FreeBSD installed on my desktop, with 2 GB of RAM and

4 GB swap partition and this swap partition is very seldom

touched by the system and then only 2-3% used.






I want to install FreeBSD on a laptop with 4 GB of RAM and a
hard disk of 100 GB. Should I waste 8 GB for a swap partition,
as it is recommended in the handbook?

Thanks for any advice,


Eugen




  
In short, no. And in fact in order to use those 4GB RAM you will need 
either FreeBSD/amd64 or a PAE kernel.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap partition

2008-01-03 Thread Jerry McAllister
On Wed, Jan 02, 2008 at 05:13:28PM -0800, Eugen Udma wrote:

 Hello,
 
 I have FreeBSD installed on my desktop, with 2 GB of RAM and
 4 GB swap partition and this swap partition is very seldom
 touched by the system and then only 2-3% used.
 
 I want to install FreeBSD on a laptop with 4 GB of RAM and a
 hard disk of 100 GB. Should I waste 8 GB for a swap partition,
 as it is recommended in the handbook?

It is not wasted as swap.
The system uses swap space for both swap and paging.

The traditional reason for making swap be 2X ram is that the system 
uses swap for taking a crash dump and that would be enough to handle 
all of ram for tracing.  

You can get by with less.  
If you are not using your laptop for development and if you are not
using it as a server with the usual large proliferation of processes
being forked off for everything, then having less swap may well be
reasonable.   But, note that you are talking only a small percentage
of your Hd space, so it is hardly worth quibbling about.

jerry

 
 Thanks for any advice,
 
 
 Eugen
 
   Looking for the perfect gift? Give the gift of Flickr! 
 http://www.flickr.com/gift/
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap partition

2008-01-03 Thread Robert Huff

Jerry McAllister writes:

  But, note that you are talking only a small percentage
  of your Hd space, so it is hardly worth quibbling about.

In most places, disk space is dirt cheap.  If you're really
worried, find a 5-10 gbyte drive used and make it a dedicated swap
disk.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap partition

2008-01-02 Thread RW
On Wed, 2 Jan 2008 17:13:28 -0800 (PST)
Eugen Udma [EMAIL PROTECTED] wrote:
 I want to install FreeBSD on a laptop with 4 GB of RAM and a
 hard disk of 100 GB. Should I waste 8 GB for a swap partition,
 as it is recommended in the handbook?


Probably not. The twice the ram rule is for people who may need to
debug kernel panics.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-08-17 Thread Andy Greenwood

Jerry McAllister wrote:

On Fri, Aug 17, 2007 at 02:05:57AM +0200, Nicholas Wieland wrote:

  
I was reading tuning(7), and I found that I should size my swap  
double the size of my physical memory.
AFAIK that was true some years ago, when memory was not as cheap as  
now, and following that guideline I should set my swap to 2GB, which  
seems far too much for swap (at least to me ...). I will never need  
this much memory as 1GB RAM and 2GB swap.
Is it still correct ? How can I resize with bsdlabel if I already  
used all my disk space during install ?



Remember, disk sizes have shot up too.
No, 2 GB is not excessive.   You can get by with less, but you're
not likely to be using proportionately as much disk now as you used
to by going with 2X - I aim for a little over 2X.

Remember that swap gets used for crash dumps and also for paging.
Now, you may think that you want to keep your machine from paging 
and in one sense that is true.   If you are so memory bound that
it has to page just to run, you're going to be so slow that it 
seems to have froze (by today's standards).   But, the system does

write stuff to page space and for processes that are often called
it can speed things up.  


So, it is not really a waste to assign that much to swap.

jerry

  

TIA,
  ngw

--
Nicholas Wieland
[EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]
  
My understanding was that you should estimate swap size based on the 
sizes of the programs which might be paged out. However, when I first 
set up my system, I didn't know this and created 1G swap slices (one on 
each disk) but I am not convinced that this was the best thing to do, 
since my system almost never uses a noticible percentage of the swap 
space. right now, I've got


[EMAIL PROTECTED] fusefs-sshfs]$ swapinfo
Device  1K-blocks UsedAvail Capacity
/dev/ad0s1b.eli   1048576 1148  1047428 0%
/dev/ad1s1b.eli   1048576 1096  1047480 0%
Total 2097152 2244  2094908 0%

And the system is under normal load. This system has 1G of RAM. Is there 
any sense in having this much swap space when it's not being used?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-08-17 Thread Paul Schmehl
--On Friday, August 17, 2007 11:07:14 -0400 Andy Greenwood 
[EMAIL PROTECTED] wrote:



Jerry McAllister wrote:

On Fri, Aug 17, 2007 at 02:05:57AM +0200, Nicholas Wieland wrote:



I was reading tuning(7), and I found that I should size my swap
double the size of my physical memory.
AFAIK that was true some years ago, when memory was not as cheap as
now, and following that guideline I should set my swap to 2GB, which
seems far too much for swap (at least to me ...). I will never need
this much memory as 1GB RAM and 2GB swap.
Is it still correct ? How can I resize with bsdlabel if I already
used all my disk space during install ?



Remember, disk sizes have shot up too.
No, 2 GB is not excessive.   You can get by with less, but you're
not likely to be using proportionately as much disk now as you used
to by going with 2X - I aim for a little over 2X.

Remember that swap gets used for crash dumps and also for paging.
Now, you may think that you want to keep your machine from paging
and in one sense that is true.   If you are so memory bound that
it has to page just to run, you're going to be so slow that it
seems to have froze (by today's standards).   But, the system does
write stuff to page space and for processes that are often called
it can speed things up.

So, it is not really a waste to assign that much to swap.

jerry



TIA,
  ngw

--
Nicholas Wieland
[EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
[EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
[EMAIL PROTECTED]


My understanding was that you should estimate swap size based on the
sizes of the programs which might be paged out. However, when I first set
up my system, I didn't know this and created 1G swap slices (one on each
disk) but I am not convinced that this was the best thing to do, since my
system almost never uses a noticible percentage of the swap space. right
now, I've got

[EMAIL PROTECTED] fusefs-sshfs]$ swapinfo
Device  1K-blocks UsedAvail Capacity
/dev/ad0s1b.eli   1048576 1148  1047428 0%
/dev/ad1s1b.eli   1048576 1096  1047480 0%
Total 2097152 2244  2094908 0%

And the system is under normal load. This system has 1G of RAM. Is there
any sense in having this much swap space when it's not being used?


Yes.  As was stated earlier, you will need that much space to save a core 
file if the system crashes.  If you don't care about troubleshooting major 
system crashes, then don't worry about it.  OTOH, disk sizes have grown so 
large that 2GB of swap is negligible use of space.  I always configure swap 
to be 2xRAM plus 200MB.  On a 300GB drive, that's less than 1% of the space 
available.


--
Paul Schmehl ([EMAIL PROTECTED])
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/


Re: Swap size

2007-08-17 Thread Jerry McAllister
On Fri, Aug 17, 2007 at 02:05:57AM +0200, Nicholas Wieland wrote:

 I was reading tuning(7), and I found that I should size my swap  
 double the size of my physical memory.
 AFAIK that was true some years ago, when memory was not as cheap as  
 now, and following that guideline I should set my swap to 2GB, which  
 seems far too much for swap (at least to me ...). I will never need  
 this much memory as 1GB RAM and 2GB swap.
 Is it still correct ? How can I resize with bsdlabel if I already  
 used all my disk space during install ?

Remember, disk sizes have shot up too.
No, 2 GB is not excessive.   You can get by with less, but you're
not likely to be using proportionately as much disk now as you used
to by going with 2X - I aim for a little over 2X.

Remember that swap gets used for crash dumps and also for paging.
Now, you may think that you want to keep your machine from paging 
and in one sense that is true.   If you are so memory bound that
it has to page just to run, you're going to be so slow that it 
seems to have froze (by today's standards).   But, the system does
write stuff to page space and for processes that are often called
it can speed things up.  

So, it is not really a waste to assign that much to swap.

jerry

 
 TIA,
   ngw
 
 -- 
 Nicholas Wieland
 [EMAIL PROTECTED]
 
 
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-08-17 Thread Robert Huff

Andy Greenwood writes:

  And the system is under normal load. This system has 1G of
  RAM. Is there any sense in having this much swap space when it's
  not being used?

1) It is - usually - better to have it and not need it, than
need it and not have it.
2) While some machines have a very predictable working set of
programs, others vary very widely.  Trying to compute the right
value is an exercise in futility.
By default, I use the 2x current or expected memory rule
split over as many physical disks as possible.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-08-17 Thread Kris Kennaway
On Fri, Aug 17, 2007 at 11:07:14AM -0400, Andy Greenwood wrote:

 My understanding was that you should estimate swap size based on the 
 sizes of the programs which might be paged out. However, when I first 
 set up my system, I didn't know this and created 1G swap slices (one on 
 each disk) but I am not convinced that this was the best thing to do, 
 since my system almost never uses a noticible percentage of the swap 
 space. right now, I've got
 
 [EMAIL PROTECTED] fusefs-sshfs]$ swapinfo
 Device  1K-blocks UsedAvail Capacity
 /dev/ad0s1b.eli   1048576 1148  1047428 0%
 /dev/ad1s1b.eli   1048576 1096  1047480 0%
 Total 2097152 2244  2094908 0%
 
 And the system is under normal load. This system has 1G of RAM. Is there 
 any sense in having this much swap space when it's not being used?

swap is there to guard against overload conditions, not for normal
load.

If you are paging during normal operations your system performance
will be terrible, so you want to make sure you have enough RAM that
this does not happen.  However, when a transient load spike comes in,
would you prefer your system to slow down but keep working, or to kill
off all your processes?  Think of it as memory space insurance.

Kris


pgpvcvTfETSpH.pgp
Description: PGP signature


Re: Swap size

2007-08-16 Thread Kris Kennaway
On Fri, Aug 17, 2007 at 02:05:57AM +0200, Nicholas Wieland wrote:
 I was reading tuning(7), and I found that I should size my swap  
 double the size of my physical memory.
 AFAIK that was true some years ago, when memory was not as cheap as  
 now, and following that guideline I should set my swap to 2GB, which  
 seems far too much for swap (at least to me ...). I will never need  
 this much memory as 1GB RAM and 2GB swap.
 Is it still correct ?

2GB is a reasonable amount of swap space, and unless you plan to turn
your system on and leave it in the closet doing nothing, it will use
more memory than you think.

 How can I resize with bsdlabel if I already  
 used all my disk space during install ?

With a bit of work you can grow partitions (see growfs), but you
cannot shrink them.

Kris


pgpxxpQnKJcpS.pgp
Description: PGP signature


Re: Swap size

2007-08-16 Thread Eric Crist


On Aug 16, 2007, at 7:05 PMAug 16, 2007, Nicholas Wieland wrote:

I was reading tuning(7), and I found that I should size my swap  
double the size of my physical memory.
AFAIK that was true some years ago, when memory was not as cheap as  
now, and following that guideline I should set my swap to 2GB,  
which seems far too much for swap (at least to me ...). I will  
never need this much memory as 1GB RAM and 2GB swap.
Is it still correct ? How can I resize with bsdlabel if I already  
used all my disk space during install ?


TIA,
  ngw



From what I understand, the reasoning behind the math is that, if  
you have a kernel dump, there's enough room in swap to put the entire  
core into swap (so it's there when you've rebooted), and that there's  
enough room left in swap to allow the system to reboot, so you can  
debug.


If you're not worried about your .core files, then I wouldn't worry  
about the math of 2xmemory.


HTH
-
Eric F Crist
Secure Computing Networks


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-07-19 Thread Derek Ragona

At 03:03 AM 7/19/2007, Gabriel Linder wrote:

Hi,

I plan to setup FreeBSD 6.2-RELEASE on my Core Duo laptop with 1GB of RAM.

The handbook says ideal swap size is 2xRAM, so should I use 2GB of swap ?


Yes unless you know how many applications will ever be run and their run 
size.  The 2xRAM is so you can always have a reasonable performance 
allowing swap.  You can still run out of swap, and this will cause a 
panic.  With disks so cheap, why not use 2XRAM?



 This seems a bit huge to me, I never used more than 400MB on Linux.
If so, is there a limit of swap partition size (or number) on i386 (for 
Linux it's 2GB per partition and 32 partitions max, but I don't know for 
FreeBSD) ?


You can add more swap using a swap file you can check that out doing:
man swapon

I don't believe there is a limit to swap partitions, other than the limit 
on other partitions.


I have no knowledge on efficiency of a swap partition vs a swap file.

-Derek 
--

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-07-19 Thread [LoN]Kamikaze
Derek Ragona wrote:
 At 03:03 AM 7/19/2007, Gabriel Linder wrote:
 Hi,

 I plan to setup FreeBSD 6.2-RELEASE on my Core Duo laptop with 1GB of
 RAM.

 The handbook says ideal swap size is 2xRAM, so should I use 2GB of
 swap ?
 
 Yes unless you know how many applications will ever be run and their run
 size.  The 2xRAM is so you can always have a reasonable performance
 allowing swap.  You can still run out of swap, and this will cause a
 panic.  With disks so cheap, why not use 2XRAM?

Running out of swap doesn't cause a panic, it causes the largest process to be
killed.


  This seems a bit huge to me, I never used more than 400MB on Linux.
 If so, is there a limit of swap partition size (or number) on i386
 (for Linux it's 2GB per partition and 32 partitions max, but I don't
 know for FreeBSD) ?

For a Desktop System 400M should be enough, I don't remember my Desktop system
to ever use more than 1m of swap. However, the swap size should be large enough
for a dump during a panic. So if you want to be able to do some debugging if
you ever run into panics, your swap should be at least as large as your memory.
Assuming that you might add more memory one day something between 2 or 4GB of
swap look reasonable to me.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap size

2007-07-19 Thread Gabriel Linder

[LoN]Kamikaze wrote:

Derek Ragona wrote:

At 03:03 AM 7/19/2007, Gabriel Linder wrote:

Hi,

I plan to setup FreeBSD 6.2-RELEASE on my Core Duo laptop with 1GB of
RAM.

The handbook says ideal swap size is 2xRAM, so should I use 2GB of
swap ?

Yes unless you know how many applications will ever be run and their run
size.  The 2xRAM is so you can always have a reasonable performance
allowing swap.  You can still run out of swap, and this will cause a
panic.  With disks so cheap, why not use 2XRAM?


Running out of swap doesn't cause a panic, it causes the largest process to be
killed.



 This seems a bit huge to me, I never used more than 400MB on Linux.
If so, is there a limit of swap partition size (or number) on i386
(for Linux it's 2GB per partition and 32 partitions max, but I don't
know for FreeBSD) ?


For a Desktop System 400M should be enough, I don't remember my Desktop system
to ever use more than 1m of swap. However, the swap size should be large enough
for a dump during a panic. So if you want to be able to do some debugging if
you ever run into panics, your swap should be at least as large as your memory.
Assuming that you might add more memory one day something between 2 or 4GB of
swap look reasonable to me.




Thanks for the precisions, I will go for 2xRAM so.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-05 Thread Jerry McAllister
On Sun, Feb 04, 2007 at 03:24:39PM -0800, Aloha Guy wrote:

 What I actually meant was, I know in the old days, if you had 128MB, you 
 want a 256MB swap but with 2GB RAM, isn't 4GB going to be overkill for a 
 swap or are you saying that a 2GB swap will work?  I'm still lost on the 
 ratio since I thought the 2x was only if you had like small amounts of RAM.

It really depends on what you are doing with the system.  
The system also pages to swap space.  Now, you really want enough
ram so that you are not depending on paging while something is
running, but if you have lots of processes with many kind of resting
until something comes up, the system may gradually use up their
in-core space for other stuff, even though the process is not 
actually swapped out.   Then, if some of those processes have to
run again, they don't half to be built up again.   The system just
pulls back in the pages it needs - not necessarily the whole thing.
It is, then good to have enough space for that.   It would take 
some observation on how your system is used to decide just how
important your swap size is.   If you are running a big enough
system that 4 GB of ram is needed, then 4 GB or even 8 GB swap 
is not so comparatively large.   You would probably be running
disk sizes in 70-160 GB size and maybe more than one, so what's 4 GB!

Anyway, you want to have enough swap to cover a crash-dump - not
that it is a frequent occurance unless you are doing development.
After all, this is FreeBSD, not MS.  But, still, it is good to have.

jerry

ps.  Please learn to break your text lines at about 70 characters.
 It makes responding much easier.
/jrm

 
 John
 
 
 - Original Message 
 From: Scott Long [EMAIL PROTECTED]
 To: Aloha Guy [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, February 4, 2007 2:28:47 PM
 Subject: Re: swap file vs swap partition
 
 
 Aloha Guy wrote:
  Thanks for the input.  You do have good points.  The only issue with 
  swap partitions is that it seems like you need to increase it everytime 
  you increase the physical memory.  Is there a swap partition size limit 
  that pretty much will handle anything and setting a number larger than 
  that will really not offer anything?
   
  John
 
 
 Processors and memory have vastly outpaced the speed of disks; any
 amount of swapping is going to be percieved as being very slow and
 something that should be avoided.  Since RAM is also very cheap now,
 most people just load enough RAM into their system to handle their load,
 and then configure enough swap to hold a crashdump of that RAM.  You
 always want swap so that you can handle unexpected spikes in load
 without crashing, but it's less of an integral piece of normal system
 operation these days.
 
 Scott
 
 
  
 
 It's here! Your new message!  
 Get new email alerts with the free Yahoo! Toolbar.
 http://tools.search.yahoo.com/toolbar/features/mail/
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Scott Long

Aloha Guy wrote:

Greetings everyone:

I am planning to build a few new boxes which will run -RELEASE and -CURRENT and 
I have a question about the swap file.  In the past, I had always used a swap 
partition of 256MB since I originally had 128MB system memory in the 1990's but 
my system has been upgraded to 2GB and it seems the swap file would have more 
flexibility as I can just change the size of the swapfile if I needed to. My 
question is is there any difference in performance between a swap file versus a 
swap partition and can one run a system with a swap file instead of a swap 
partition?


Yes.  A swap file requires a pass through the filesystem code in order
to figure out where each block is.


Also, searching has not gotten me very far but are there any drawbacks to a 
swap file instead of a swap partition?  I read somewhere that a few people seem 
to think that a swap file can't handle kernel crash dumps?


That's correct, it cannot.


Shouldn't it be the same as both of them occupy disk space and as long as the 
swap file is large enough, wouldn't it work?


The crashdump code is written to assume that the dump space is
completely contiguous, something that is not at all guaranteed by
a swap file.  While it would certainly be possible to modify it
to make a pass through the filesystem like above, the intention
of the crashdump code is also to be as simple as possible and to
depend on as few kernel services as possible.  When the system has
crashed, who knows what can be trusted anymore, right?  Also, filesystem
corruption is a frequent cause of crashes; why risk that dumping to
a swapfile might encounter corruption and trash your entire filesystem.

Scott

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Aloha Guy
Thanks for the input.  You do have good points.  The only issue with swap 
partitions is that it seems like you need to increase it everytime you increase 
the physical memory.  Is there a swap partition size limit that pretty much 
will handle anything and setting a number larger than that will really not 
offer anything?

John

- Original Message 
From: Scott Long [EMAIL PROTECTED]
To: Aloha Guy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 4, 2007 12:16:37 PM
Subject: Re: swap file vs swap partition


Aloha Guy wrote:
 Greetings everyone:
 
 I am planning to build a few new boxes which will run -RELEASE and -CURRENT 
 and I have a question about the swap file.  In the past, I had always used a 
 swap partition of 256MB since I originally had 128MB system memory in the 
 1990's but my system has been upgraded to 2GB and it seems the swap file 
 would have more flexibility as I can just change the size of the swapfile if 
 I needed to. My question is is there any difference in performance between a 
 swap file versus a swap partition and can one run a system with a swap file 
 instead of a swap partition?

Yes.  A swap file requires a pass through the filesystem code in order
to figure out where each block is.

 Also, searching has not gotten me very far but are there any drawbacks to a 
 swap file instead of a swap partition?  I read somewhere that a few people 
 seem to think that a swap file can't handle kernel crash dumps?

That's correct, it cannot.

 Shouldn't it be the same as both of them occupy disk space and as long as the 
 swap file is large enough, wouldn't it work?

The crashdump code is written to assume that the dump space is
completely contiguous, something that is not at all guaranteed by
a swap file.  While it would certainly be possible to modify it
to make a pass through the filesystem like above, the intention
of the crashdump code is also to be as simple as possible and to
depend on as few kernel services as possible.  When the system has
crashed, who knows what can be trusted anymore, right?  Also, filesystem
corruption is a frequent cause of crashes; why risk that dumping to
a swapfile might encounter corruption and trash your entire filesystem.

Scott


 

Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Scott Long

Aloha Guy wrote:
Thanks for the input.  You do have good points.  The only issue with 
swap partitions is that it seems like you need to increase it everytime 
you increase the physical memory.  Is there a swap partition size limit 
that pretty much will handle anything and setting a number larger than 
that will really not offer anything?
 
John



Processors and memory have vastly outpaced the speed of disks; any
amount of swapping is going to be percieved as being very slow and
something that should be avoided.  Since RAM is also very cheap now,
most people just load enough RAM into their system to handle their load,
and then configure enough swap to hold a crashdump of that RAM.  You
always want swap so that you can handle unexpected spikes in load
without crashing, but it's less of an integral piece of normal system
operation these days.

Scott
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Aloha Guy
What I actually meant was, I know in the old days, if you had 128MB, you want a 
256MB swap but with 2GB RAM, isn't 4GB going to be overkill for a swap or are 
you saying that a 2GB swap will work?  I'm still lost on the ratio since I 
thought the 2x was only if you had like small amounts of RAM.

John


- Original Message 
From: Scott Long [EMAIL PROTECTED]
To: Aloha Guy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, February 4, 2007 2:28:47 PM
Subject: Re: swap file vs swap partition


Aloha Guy wrote:
 Thanks for the input.  You do have good points.  The only issue with 
 swap partitions is that it seems like you need to increase it everytime 
 you increase the physical memory.  Is there a swap partition size limit 
 that pretty much will handle anything and setting a number larger than 
 that will really not offer anything?
  
 John


Processors and memory have vastly outpaced the speed of disks; any
amount of swapping is going to be percieved as being very slow and
something that should be avoided.  Since RAM is also very cheap now,
most people just load enough RAM into their system to handle their load,
and then configure enough swap to hold a crashdump of that RAM.  You
always want swap so that you can handle unexpected spikes in load
without crashing, but it's less of an integral piece of normal system
operation these days.

Scott


 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Daniel O'Connor
On Monday 05 February 2007 08:58, Scott Long wrote:
 Processors and memory have vastly outpaced the speed of disks; any
 amount of swapping is going to be percieved as being very slow and
 something that should be avoided.  Since RAM is also very cheap now,
 most people just load enough RAM into their system to handle their load,
 and then configure enough swap to hold a crashdump of that RAM.  You
 always want swap so that you can handle unexpected spikes in load
 without crashing, but it's less of an integral piece of normal system
 operation these days.

Mini-dumps have made it a lot easier to get away with a small amount of swap.
That said it's not like disk is expensive either!

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgpzXapmx8DNB.pgp
Description: PGP signature


Re: swap file vs swap partition

2007-02-04 Thread Richard Lynch
On Sun, February 4, 2007 3:53 pm, Aloha Guy wrote:
 Thanks for the input.  You do have good points.  The only issue with
 swap partitions is that it seems like you need to increase it
 everytime you increase the physical memory.  Is there a swap partition
 size limit that pretty much will handle anything and setting a number
 larger than that will really not offer anything?

What you *might* consider doing:

A swap partition the size of *ONE* RAM chip.

A swap file the size of all your RAM chips.

If you are having kernel panics, you can pull out RAM and then get
your kernel dump, I would presume.

This is a made-up answer from a guy who has no idea what he's talking
about, really...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap file vs swap partition

2007-02-04 Thread Peter Jeremy
Please wrap your lines and don't top-post.

On Sun, 2007-Feb-04 15:24:39 -0800, Aloha Guy wrote: What I actually
meant was, I know in the old days, if you had 128MB, you want a 256MB
swap but with 2GB RAM, isn't 4GB going to be overkill for a swap or
are you saying that a 2GB swap will work?  I'm still lost on the
ratio since I thought the 2x was only if you had like small amounts
of RAM.

2:1 was a very old rule of thumb.  A better approach is to consider
your workload:  Your working set needs to fit in RAM and the total
virtual size needs to fit into RAM+swap.  If you tend to leave lots
of large processes lying around not doing anything, you might be
able to usefully use much more swap than if you religiously kill
processes that you aren't using - particularly if you don't have
massive amounts of RAM.  My desktop at work typically runs with
swap utilisation about twice RAM (but it only has ~160MB RAM).

Keep in mind that you can use multiple swap partitions so it can
be useful to have an active swap on each disk.  (The VM system
stripes across available swaps).

-- 
Peter Jeremy


pgpMv9rkbZ7oC.pgp
Description: PGP signature


Re: SWAP priority

2006-10-02 Thread Chuck Swiger

Bob wrote:
It became obvious after a short while, that I had too little physical memory 
(1GB), and I was using swap often. While swapping, things slowed down. So, I 
added an additional 1GB of swap space (via swap file) on the secondary file 
system. I did this as per the manual.


I now have more swap; my question is this: How can I tell the OS to use the 
new swap file BEFORE using the old one? Is there a way to tell the system to 
prioritize the use of multiple swaps?


The swap system knows how to interleave data between the additional swap areas 
relatively efficiently, but if your current workload is so demanding that you 
need to use more than 2GB of swapspace on a machine with 1GB of RAM, you 
should add more RAM, not more swapspace


--
-Chuck
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: SWAP priority

2006-10-02 Thread Bob
On Monday 02 October 2006 09:14, Chuck Swiger wrote:

 The swap system knows how to interleave data between the additional swap
 areas relatively efficiently, 

Yes I discovered that. The additional swap space was instantly used as soon as 
I activated it; and the added swap improved things measurably. Does the swap 
system take into account current disk activity when it decides to use a 
particular swap?

 that you need to use more than 2GB of swapspace on a machine with 1GB of
 RAM, you should add more RAM, not more swapspace
 
It is on order. 

The basis for my question about swap priority was based on an observation that 
the slowdown was due to swapping AND heavy disk usage. I noticed that when 
snapshots were being made on the main drive (the one I am using all the 
time), all other processes went to slow-mode. You see, the lack of enough 
memory caused the system to swap, and it swapped to the heaviest used raid 
array. I thought if I could force the system to swap to the other raid array 
(much less used) with the new swapfile, things would improve even more.

All will be cured when more ram is installed, but I thought it would be 
interesting playing with swap priority.
 
Bob
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: SWAP priority

2006-10-02 Thread Charles Swiger

On Oct 2, 2006, at 2:06 PM, Bob wrote:

On Monday 02 October 2006 09:14, Chuck Swiger wrote:
The swap system knows how to interleave data between the  
additional swap

areas relatively efficiently,


Yes I discovered that. The additional swap space was instantly used  
as soon as
I activated it; and the added swap improved things measurably. Does  
the swap
system take into account current disk activity when it decides to  
use a

particular swap?


Sort of.  The syncer process runs at idle priority, so normal I/O  
initiated by your processes will take priority over paging/swapping  
idle pages of RAM out.  There may be additional logic involved to  
help balance I/O in terms of which swapfile is being used if one  
drive remains busier than another, but I am not completely familiar  
with FreeBSD's implementation.


that you need to use more than 2GB of swapspace on a machine with  
1GB of

RAM, you should add more RAM, not more swapspace


It is on order.

The basis for my question about swap priority was based on an  
observation that
the slowdown was due to swapping AND heavy disk usage. I noticed  
that when
snapshots were being made on the main drive (the one I am using all  
the
time), all other processes went to slow-mode. You see, the lack of  
enough
memory caused the system to swap, and it swapped to the heaviest  
used raid
array. I thought if I could force the system to swap to the other  
raid array
(much less used) with the new swapfile, things would improve even  
more.


Well, you might try benchmarking the system with both arrays used for  
swapping and with only the less-busy RAID array being used for  
swapping, and see which one does better.


--
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: SWAP priority

2006-10-02 Thread Bob
On Monday 02 October 2006 14:23, Charles Swiger wrote:


 Well, you might try benchmarking the system with both arrays used for
 swapping and with only the less-busy RAID array being used for
 swapping, and see which one does better.

Yes, this is what I will do; if not benchmark, at least get a subjective feel 
for which is faster.

Sorry to be a pest, but how can I do what you suggest? My SWAP0 is a 
_partition_  on the  raid0 volume , and SWAP1 is a swapfile on raid1 created 
as a Vnode; and activated in rc.conf by swapfile=/raid1/swap1 
 
How can I tell FreeBSD to ignore the primary swap partition?  I set that 
partition  up during the online install process if I recall, and none of 
my /etc/ files seem to reference it directly :-(

I will also want to double the size of SWAP1 to 2GB, so the experiment is 
comparing the same swap space; but that part is simplistic.

Bob
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: SWAP priority

2006-10-02 Thread Norberto Meijome
On Mon, 2 Oct 2006 16:31:47 -0400
Bob [EMAIL PROTECTED] wrote:

 Sorry to be a pest, but how can I do what you suggest? My SWAP0 is a 
 _partition_  on the  raid0 volume , and SWAP1 is a swapfile on raid1 created 
 as a Vnode; and activated in rc.conf by swapfile=/raid1/swap1 
  
 How can I tell FreeBSD to ignore the primary swap partition?  I set that 
 partition  up during the online install process if I recall, and none of 
 my /etc/ files seem to reference it directly :-(

comment out the line swapfile in rc.conf .

B

_
{Beto|Norberto|Numard} Meijome

Science Fiction...the only genuine consciousness expanding drug
  Arthur C. Clarke

I speak for myself, not my employer. Contents may be hot. Slippery when wet.
Reading disclaimers makes you go blind. Writing them is worse. You have been
Warned.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap Size Importance?

2006-09-29 Thread John Nielsen
On Friday 29 September 2006 11:52, Chris wrote:
 As a standard practice, I've always configured swap file to be double
 the size of real ram split across system and data disk. For example,
 8gb on da0 and 8gb on da1 if the system has 8g real ram. In practice,
 In 7 or 8 years, I've never seen swap used for anything but a few k
 of inactive processes and I would imagine if real active process
 swapping occurred, it would be an immediate indicator that the system
 that isn't responsive enough for use anymore and requires upgrade or
 tuning. Can't run a website process off disk and keep anyone coming
 to the site ;-). (BTW, I'm talking only about high end servers, not
 test boxes where I've seen lots of swapping).

 I'm at the point of attempting my first gvinum software raid-5 and
 realized, I need the entire disk storage of all three non-system
 drives to avoid pulling an 8gb chunk out of the drive sizes. The
 configuration is one scsi 72g system disk and 3 that will be used for
 the raid volume. I should mention I turn off dumps, haven't found the
 use for that in a production server since it should not be rebooting
 or it's back in the shop and another box is taking it's place.

 Is there any shortfall in performance or reliability to running
 production with swap equal in size to the 8gb of system memory? I
 can't think of any but don't want to make a hard to correct mistake
 once this thing goes in.

Nope. I routinely run boxes with 512MB or 1GB of swap, even if the RAM size is 
much higher than that. You won't have anywhere to save a crashdump in that 
case, but you seem to already be aware of that.

JN
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap Size Importance?

2006-09-29 Thread Jerry McAllister
On Fri, Sep 29, 2006 at 08:52:58AM -0700, Chris wrote:

 As a standard practice, I've always configured swap file to be double  
 the size of real ram split across system and data disk. For example,  
 8gb on da0 and 8gb on da1 if the system has 8g real ram. In practice,  
 In 7 or 8 years, I've never seen swap used for anything but a few k  
 of inactive processes and I would imagine if real active process  
 swapping occurred, it would be an immediate indicator that the system  
 that isn't responsive enough for use anymore and requires upgrade or  
 tuning. Can't run a website process off disk and keep anyone coming  
 to the site ;-). (BTW, I'm talking only about high end servers, not  
 test boxes where I've seen lots of swapping).
 
 I'm at the point of attempting my first gvinum software raid-5 and  
 realized, I need the entire disk storage of all three non-system  
 drives to avoid pulling an 8gb chunk out of the drive sizes. The  
 configuration is one scsi 72g system disk and 3 that will be used for  
 the raid volume. I should mention I turn off dumps, haven't found the  
 use for that in a production server since it should not be rebooting  
 or it's back in the shop and another box is taking it's place.
 
 Is there any shortfall in performance or reliability to running  
 production with swap equal in size to the 8gb of system memory? I  
 can't think of any but don't want to make a hard to correct mistake  
 once this thing goes in. 

It really depends on the number and size of processes you will be
running.  It you have a large memory and generally run a mix of
processes that will totally fit in memory, then it probably doesn't
doesn't matter much.   But, if you run enough to actually cause 
paging - which goes to swap space - then it becomes an issue.  Also,

I think some things that get pulled to execute often can get left
in swap space and accessed more quickly that all the way from main
disk each time.  eg the system keeps track of what it has in swap and 
it is more efficient to read from swap - less overhead.   But someone 
else should know more about that than I.

jerry

 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap Size Importance?

2006-09-29 Thread Chris


On Sep 29, 2006, at 9:06 AM, Jerry McAllister wrote:


On Fri, Sep 29, 2006 at 08:52:58AM -0700, Chris wrote:



Is there any shortfall in performance or reliability to running
production with swap equal in size to the 8gb of system memory? I


doesn't matter much.   But, if you run enough to actually cause
paging - which goes to swap space - then it becomes an issue.  Also,

I am assuming that real paging of active processes is death to that  
server anyway and means something else has to be throttled back with  
tuning of network bufs, apache or mysql. Same for crash dumps, can't  
run a server that is taking dumps or you lose your traffic.



I think some things that get pulled to execute often can get left
in swap space and accessed more quickly that all the way from main
disk each time.  eg the system keeps track of what it has in swap and
it is more efficient to read from swap - less overhead.   But someone


This is the part that concerned me. If one views a top on well  
running system and sees no swapping, I wanted to make certain there  
is no magic going on behind the scenes where processes have been  
mapped to swap in such a way that I could be currently benefitting  
from swap being higher than actual and not know it. If top is an  
accurate read on whether the system has placed high use processes in  
swap then it would suggest the first post is correct, and a memory  
rich system, where you configure to never exceed real memory, wastes  
that storage taken in swap. For expensive drives, given the sizes we  
use in RAM now, it's hard to justify. In the case of attempting this  
raid-5 configuration, it equates to the loss of 24G in scsi storage.  
I will run with 8g on the system drive.


Thank you very much for the responses.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap

2006-09-24 Thread Dan Nelson
In the last episode (Sep 24), Pietro Cerutti said:
 512 MB of Ram, 1024 MB of swap, 6.1-STABLE
 
 After some time my system begins swapping, which is normal.
 The weird thing is that swapping goes on even after closing the memory
 consuming programs.
 
 here's the output of top(1):
 
 Mem: 103M Active, 37M Inact, 107M Wired, 6656K Cache, 60M Buf, 240M Free
 Swap: 1024M Total, 106M Used, 918M Free, 10% Inuse

I se no swapping here (that would show up as ###K In, ###K Out on the
swap line).  You have swap space in use but not actively used.
 
 Why the swapped pages don't get recalled back to main mamory (which
 has sufficient free space for them), freeing the swap device and thus
 speeding the system up?

Once the kernel decides to swap a page, that area of swap is reserved
until the process exits, even if the kernel pulls the data back from
swap.  That way if memory gets low again, the kernel knows it can
quickly discard the in-RAM copy of the data (since there's already a
copy in swap).

Processes likely to have pages swapped out are gettylogin proceses for
unused ttys, lpd, sshd and other long-running daemons, etc.  There's no
reason to pull those pages back into RAM because you're more likely to
need that RAM for something else.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: swap

2006-09-24 Thread Pietro Cerutti

On 9/24/06, Dan Nelson [EMAIL PROTECTED] wrote:

Once the kernel decides to swap a page, that area of swap is reserved
until the process exits, even if the kernel pulls the data back from
swap.  That way if memory gets low again, the kernel knows it can
quickly discard the in-RAM copy of the data (since there's already a
copy in swap).


Thanx for the insight...


--
Dan Nelson
[EMAIL PROTECTED]




--
Pietro Cerutti
ICQ: 117293691
PGP: 0x9571F78E

- ASCII Ribbon Campaign -
against HTML e-mail and
proprietary attachments
  www.asciiribbon.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Swap Performance in 6.1?

2006-05-11 Thread Kris Kennaway
On Wed, May 10, 2006 at 04:36:15PM -0700, Timothy Beyer wrote:
 
 I am curious if this problem has been resolved in 6.1:
 
 (it was previously on the FreeBSD 6.1 Open Issues page, but I don't
 see it there any more)
 http://www.tr.freebsd.org/releases/6.1R/todo.html
 
 swapping on 6.0 is slower than on 4.x
 Not done
 Performance on swap handling is much slower than 4.x and this can make 
 a system essentially unusable when moderate paging activity is going on
 
 Has this been resolved, (I did not see anything about it in the 6.1
 release notes, or the errata) or has it been deferred to a future
 release?  (The reason why I ask this is that programs like Firefox and
 Xemacs use up all of my 1 GB of memory and I have noticed problems of
 this nature in 6.0)

The TODO item should have been worded better.  There is anecdotal
evidence that it is slower, but no-one has actually measured it
definitively.  Therefore it will be deferred until the future, after
someone has actual numbers showing whether/how much slower it is, or
not.

Kris


pgpFcIrV4mnuZ.pgp
Description: PGP signature


Re: swap - 2 HDs

2005-12-16 Thread Will Maier
On Fri, Dec 16, 2005 at 09:33:57AM -0300, Aguiar Magalhaes wrote:
 I have a machine with: dual processor AMD 64 bits, 4
 GB RAM and 2 HDs SCSI 73 GB.
 
 How can I configure the swap area ?

If you haven't completed the install, make the swap during the
install when you configure the disks. If you've already finished the
install, the Handbook has a section[0] describing methods for adding
swap.

 Is It recommended to configure  swap area in both HDs ?? 

I don't see the point -- swap is where pages that don't fit in your
real memory go. It's less optimal than real memory in terms of
latency, but I don't see how two disks would make swap performance
much better.

 How large ??

I'd suggest 1-4G of swap depending on whether you need to read full
dumps of the kernel/memory for debugging. If you don't, you'll
probably be fine with a lesser amount of swap, unless you'll be
running applications which will overload the memory.

[0] 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/adding-swap-space.html

-- 

o--{ Will Maier }--o
| jabber:[EMAIL PROTECTED] | email:[EMAIL PROTECTED] |
| [EMAIL PROTECTED] | [EMAIL PROTECTED] |
*--[ BSD Unix: Live Free or Die ]--*
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


  1   2   >