Re: Swap space

From: Lowell Gilbert (freebsd-questions-local_at_be-well.ilk.org)
Date: 11/01/05

  • Next message: Steve Bertrand: "RE: Quick Routing Question"
    To: Bob Johnson <fbsdlists@gmail.com>
    Date: 01 Nov 2005 11:10:35 -0500
    
    

    Bob Johnson <fbsdlists@gmail.com> writes:

    > On 11/1/05, Ian Lord <mailing-lists@msdi.ca> wrote:
    > > Hi,
    > >
    > > I just bought 4 servers with 4 gigs of ram, the documentation
    > > proposes to use 2 to 3 times the amount of ram for swap... I don't
    > > think 12 gigs of swap would be useful lol, but do I really need to
    > > put 4 gigs of ram. (It might be useful for kernel dump but...)
    > >
    >
    > That's the original reason for the suggestion. You need more than
    > twice the amount of RAM if you need to capture a dump for debugging.
    > If you won't ever be doing that, you may not need so much swap.

    Not quite:
    >From dumpon(8) on 5-STABLE:

         For most systems the size of the specified dump device must be at
         least the size of physical memory. Even though an additional
         header is added to the dump, the BIOS for a platform typically
         holds back some memory, so it is not usually necessary to size
         the dump device larger than the actual amount of RAM available in
         the machine.

    > My experience is that if you have much more than twice the RAM size
    > swapped out, things start to get so sluggish that it is better to find
    > a way to reduce your memory requirement or provide more physical
    > memory. Of course, that is characteristic of MY usage and may not
    > apply at all to your usage, but it may be the reason that 3xRAM is the
    > upper limit of what is routinely recommended.

    Interactive single-user use will probably act like that nearly all the
    time. High page fault rates will always slow the system down. It's
    not necessary the case that a system will maintain high paging rates
    when it's gone deep into swap, but the exceptions are rather special
    cases.

    > > What do you guys do with swap space in this scenario ?
    >
    > Provide what you think you will need. It depends on what you expect
    > to be doing with your memory. A busy mail server that will be using
    > huge amounts of temporary storage to manipulate the messages may not
    > need a lot of swap, simply because you might prefer to throttle
    > incoming mail when the system gets heavily loaded rather than get deep
    > into swap and slow the system down.

    That's an interesting example, but it's still just an example; it
    won't necessarily apply to all mail servers, especially configurations
    that use a lot of short-lived files.

    The basic advice is quite sound, so I'll reiterate it: Provide what
    you think you might ever need. If in doubt, err on the side of
    caution.

    > I configured my new 4GB servers with 4GB of swap. That's more than I
    > expect to ever need, but I have oodles of disk space. If you have
    > multiple drives, you may want to spread that out among the drives for
    > more efficiency (but to do a dump you need enough contiguous space on
    > one drive).

    For ordinary desktop or server use, I think it's always a good idea to
    have enough swap for a kernel dump. It's cheap insurance.
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: Steve Bertrand: "RE: Quick Routing Question"

    Relevant Pages

    • RE: Hangs during "dump" with 6.0 and current ports
      ... Due to lack of memory I had added an additional swap-file via mdconfig 3 ... filesystem with snapshots active and the swapfile is in the same filesystem ... Hangs during "dump" with 6.0 and current ports ... Maybe you need some more swap space? ...
      (freebsd-questions)
    • Re: Dying processes (inetd, cron, syslogd, sshd)
      ... to fit by limiting the amount of memory seen by the kernel. ... bit less than actual size of your dump area in place of "100m"). ... such a process usually writes a core dump. ... nearly as large as your combined RAM + swap. ...
      (comp.unix.sco.misc)
    • Re: reboot after panic
      ... This mother board has both sata and pata controllers but I am using only pata ... A kernel panic causes the kernel to dump all memory contents (from start ... My guess is that you either don't have any swap defined, ...
      (freebsd-stable)
    • Re: [RFC][PATCH 2/9] deadlock prevention core
      ... don't try to swap over the network. ... We could track dirty anonymous memory and throttle. ... the theoretical max amount of memory one can 'lose' in socket ... to be stuck in wait queues. ...
      (Linux-Kernel)
    • Re: Question about top values on memory usage
      ... Another question is that is httpd uses threads (as provided by FreeBSD) ... SIZE is the total amount of virtual memory that a process has allocated. ... RES is the amount of physical memory in use by the process and will only include that part of a process's virtual memory space which is currently allocated in physical memory. ... The amount of swap space will place a hard upper bound on the number of httpd processes you can run before sbrk start failing. ...
      (freebsd-stable)