cancel
Showing results for 
Search instead for 
Did you mean: 

reserve swap for root

dom kris
Frequent Advisor

reserve swap for root

Hi,

yesterday one of system's hung since there was no more swap (process/script went crazy).
It was not possible to kill the processes that used the swap since there was no more mem/swap to start a shell to to execute the 'ps', 'kill' cmds.

Is is possible to reserve a part of the swap or have a dedicated swap to execute some commands or for root.
Whatever happens, root will always have enough swap/mem to execute a minimal subset of cmds.

I don't know if this makes any sense but it would be useful to have this.

Kris
4 REPLIES
Ralf Puchner
Honored Contributor

Re: reserve swap for root

there are 2 different swapping methods - have a look for an explanation into the admin guide delivered with the OS.

There is no way to reserve a memory dedicated for an user for special use (you can only reserve memory manually by a program and release it if necessary but this indicates you have a shell available to quit the program)

This is the reason why tuning is done for the applications. It is to the administrator to configure the machine properly to have enough resources available.


Help() { FirstReadManual(urgently); Go_to_it;; }
dom kris
Frequent Advisor

Re: reserve swap for root

The problem is not resources. Sometimes it happens that a program spawns off a very large number of procs thus eating away all system resources.
If you could just kill these procs, the problem would be solved but since there are no more system resources, you cannot do this.
So, if you could reserve some system resource for such situations, you could fix the problem without having to do a power on/power off
Ralf Puchner
Honored Contributor

Re: reserve swap for root

you are talking in this case about resources. Resources are: processes, filehandles, memory, cpu time etc. all be configurable.

If a "wild" process spawns faster than releasing old resources it is an application problem. In this case calculate the maximum and configure the os not to reach the limit. If not possible write script preventing this situation or reconfigure application.
Help() { FirstReadManual(urgently); Go_to_it;; }
Michael Schulte zur Sur
Honored Contributor

Re: reserve swap for root

Hi,

in case you wonder, what Ralf is talking about, try
sysconfig -q proc
for that user and limit for example the process per user value.
Then the process will only be able to spawn a certain amount processes.

greetings,

Michael