30 May 2011 15:59
Re: Swap device priorities in Solaris?
On Sun, May 29, 2011 at 5:24 AM, Jim Klimov <jimklimov@...> wrote: > And actually your comment on the Sun/Oracle blog pretty much sums it up - > why sometimes much swap should be reserved and may get used even > if in practice we hope it is hever touched. If some runaway process eats > up all VM, we still want the system to be responsive enough as to get in > and kill that process. Or let it complete in a timely fashion... While this type of administration is sometimes necessary, generally I see this as an indication of a bad application that needs babysitting. I prefer to train Solaris to do that babysitting than performing fire drills every time an application misbehaves. You may want to look at using ulimit -d (or maybe ulimit -v) to keep individual processes from doing bad things. ulimit values are inherited by from parent to child (setting ulimit in a shell gets inherited by a process created by that shell). You can use plimit to change an existing process' ulimits or view the ulimits for running processes. If a process tries to use too much memory, it will be killed - the same thing you would do if you were to log in to take care of the bad process. If you use SMF to manage the starting and stopping, it will be automatically restarted after it is killed for consuming too much memory. In this case, you probably want to use ulimit in the start script before starting the actual process. If you have a collection of processes that you are trying to put a limit on, you can run those in a resource controlled zone. Like in the URL I give below, zone.max-swap refers to memory reservations. Setting a limit on physical memory can actually induce paging (to swap(Continue reading)
RSS Feed