Hi all,
Actually I asked this question because I saw a lot of times systems that had more than 10Gb of free physical memory and they anyway used swap partition(about 1-5 Mb). I saw that happened on FreeBSD and on Linux, so I thought it's possible to see that again when I'll run HAProxy. And I doubt that userspace application can control itself memory management process, i.e. you can't say in your program "give me memory and never use paging/swapping for it". I suppose it's the authority of OS. (I might be wrong of course, and maybe HAProxy deals with it in exactly such way). And as Ben said there's an option to tune /proc/sys/vm/swapiness. And as far as I can understand now it's the only option to prevent swapping...
Sat, 19 Mar 2011 08:59:14 +0100 письмо от Baptiste <bedis9#gmail.com>:
> Hey,
>
> You can also play with "/proc/sys/vm/swapiness" to avoid / limit swapping...
> But as explained, it's a bad idea to let a lot balancer swapping. It's
> supposed to introduce a very very low delay and swapping would
> increase that delay.
> Just ensure you have enough memory to handle the load you need/want.
>
> cheers
>
>
> On Fri, Mar 18, 2011 at 7:33 PM, Ben Timby <btimby#gmail.com> wrote:
> > On Fri, Mar 18, 2011 at 2:00 PM, Antony <ddjjzz#mail.ru> wrote:
> >> Hi guys!
> >>
> >> I'm new to HAProxy and currently I'm testing it.
> >> So I've read this on the main page of the web site:
> >> "The reliability can significantly decrease when the system is pushed to
> its limits. This is why finely tuning the sysctls is important. There is no
> general rule, every system and every application will be specific. However, it
> is important to ensure that the system will never run out of memory and that
> it will never swap. A correctly tuned system must be able to run for years at
> full load without slowing down nor crashing."
> >> And now have the question.
> >>
> >> How do you usually prevent system to swap? I use Linux but solutions for
> any other OSes are interesting for me too.
> >>
> >> I think it isn't just to "swapoff -a" and to del appropriate line in
> /etc/fstab. Because some people say that it isn't good choise..
> >
> > Prevent swapping by ensuring your resource limits (max connections)
> > etc. keep the application from exceeding the amount of physical
> > memory.
> >
> > Or conversely by ensuring that your physical memory is sufficient to
> > handle the load you will be seeing.
> >
> > This is what is referred to in the documentation, you need to tune
> > your limits and available memory for the workload you are seeing. Of
> > course simple things like not running other memory hungry applications
> > on the same machine apply as well. This is an iterative process
> > whereby you observe the application, make adjustments and repeat. You
> > must generate test load within the range of normal operations for this
> > tweaking to be true-to-life. Of course once you go into production the
> > tweaking will continue, no simulation is a replacement for production
> > usage.
> >
> > The reason running without swap is bad is because if you hit the limit
> > of your physical memory, the OOM killer is invoked. Any process is
> > subject to termination by the OOM killer, so in most cases decreased
> > performance is more acceptable than loss of a critical system process.
> >
> >
Received on 2011/03/19 11:58
This archive was generated by hypermail 2.2.0 : 2011/03/19 12:00 CET