From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078731111705.tru64-unix-managers.marc@archive.invalid> From: "Irene A. Shilikhina" Date: Wed, 02 Dec 1998 12:26:51 +0000 To: tru64-unix-managers Subject: [SUMMARY]: System paralysed due to X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078731111705 In my original posting I described the situation that had brought my=20 system to a clinch the only exit from which had been turning the system off... I was worried how to prevent the system from such things for the=20 future. Thanks to:=20 Peter Chapin Alan Rollow =20 Steve VanDevender whose advices will help me to avoid such troubles in the perspective. Peter Chapin invokes ulimit command for ordinary users in /etc/profile to= =20 limit data and stack segment sizes as well as CPU time and core file size. It does prevent an ordinary user from accidently running a program that tries to acquire all system resources. Alan Rollow thinks that the only cure on such an old and limited system=20 is to get more physical memory or limit the amount of virtual memory that= =20 can be used and that changing the process limits for data size may also=20 have an affect. Having looked through the documentation on Tuning Subsystem and appropriate manuals, I've arrived at a conclusion that I should tune the following=20 system parameters: vm: vm-maxvas =3D ... proc: max-per-proc-address-space =3D ... per-proc-address-space =3D ... max-per-proc-data-size =3D ... per-proc-data-size =3D ... This may be made using "sysconfig" facility that maintains the kernel=20 subsystem configuration. As it occured, now max-per-proc-address-space, per-proc-address-space, and max-per-proc-data-size, each is equal 1073741824, i.e. 1 Gbyte, whereas the swap space is only 160 Mbyte and=20 memory equals 56936 Kbyte (64 Mbyte - the memory occupied by the kernel)=20 which is almost 5 times less (as it was from the very beginning in our FIS)= . Steve VanDevender finds that we should use lazy swapping mode instead of=20 immediate. The full answers and my original mail are beneath my signature. Thanks again,=20 Irene ************************************************************************* * * * Irene A. Shilikhina e-mail: irene@alpha.iae.nsk.su * * System administrator, * * Institute of Automation & Electrometry, * * Siberian Branch of Russian Academy of Sciences, * * Novosibirsk, Russia * * http://www.iae.nsk.su/~irene * ************************************************************************* * * * * The road to hell is paved with * Every cloud has a silver lining. * * good intentions. * * * * * ************************************************************************* From=20pchapin@twilight.vtc.vsc.eduWed Dec 2 15:56:12 1998 Date: Tue, 1 Dec 1998 06:41:17 -0500 (EST) From: Peter Chapin To: "Irene A. Shilikhina" Subject: Re: System paralysed due to "Unable to obtain requested swap space= " On Tue, 1 Dec 1998, Irene A. Shilikhina wrote: > - why didn't the system refuse the first task having created troubles wi= th > swap space (immediate mode!) or didn't drop any process itself in such=20 > situation? According to time stamps, the problem arose in starting the=20 > first program;=20 I can't answer this one. > - how can I avoid it in the future? Avoiding "denial of service" attacks -- which this essentially was (even though the user was not malicious) -- is generally difficult. On my system I invoke ulimits on ordinary users in /etc/profile like so: # Set up process limits. These soft limits can be increased by the # user. They are here only to prevent run-away programs from # killing the system. ulimit -Sd 20480 # 20 MByte data segment size. ulimit -Ss 20480 # 20 MByte stack segment size. ulimit -St 3600 # 1 Hour of CPU time. ulimit -Sc 2048 # 1 MByte core file size. ulimit -Sn 1024 # 1024 open files. This, of course, only works for users who are using a shell that understands the ulimit command (such as ksh or bash). Also it does not provide any real security since the user can change these limits. However, it does prevent an ordinary user from accidently running a program that tries to acquire all system resources. Since my users are students learning to program, I deem this method to be a useful safeguard. In fact, it has often caused buggy student programs to be killed long before the system has suffered. I think this method has been quite effective for us at this site. Note: This technique does not stop a user from running a large number of small programs. It won't prevent a malicious attack -- just a few types of accidents. Peter pchapin@twilight.vtc.vsc.edu http://twilight.vtc.vsc.edu/~pchapi= n/ ***************************************************************************= ** From=20alan@nabeth.cxo.dec.comWed Dec 2 15:55:49 1998 Date: Tue, 1 Dec 1998 07:58:47 -0700 From: "Alan Rollow - Dr. File System's Home for Wayward Inodes." To: irene@alpha.iae.nsk.su Subject: Re: System paralysed due to "Unable to obtain requested swap space= " It is more likely that the system is slow because you don't have enough physical memory to support 160 MB of virtual memory that=20 processes are trying to use. The reservation of page and swap=20 space doesn't require any disk I/O. The use of that page/swap=20 space does. The noise the disk is making could easily be a=20 heavy I/O load trying to page and swap. The 10% and related messages suggest that there are processes trying to use even more virtual memory and failing. If they were successful, the performance problem would be even worse. You can use vmstat(1) to look at the paging performance counters to see if how much paging is going on. Look at the number of page-outs and swap-ins and swap-outs. The task related message probably indicates that something is trying to start lots of processes and failing because the proc table or thread table isn't large enough. More processes or threads will try to use even more virtual memory, which will probably increase the frequency of running out of page and swap space. The only cure for paging performance problems on such an old and limited system is to get more physical memory or limit the amount of virtual memory that can be used. On systems that can support multiple I/O adapters, there might be some small benefit to splitting the paging I/O across multiple busses and devices. But, it is always better to not page, than to page more quickly. To limit the amount of virtual memory that can be used, you'd want to lower amount of page and swap space. Changing the process limits for data size may also have an=20 affect. Some programs see how much virtual memory they can use and then simply use that much. A more limited data size would force such programs to be smaller. ***************************************************************************= ** From=20stevev@hexadecimal.uoregon.eduWed Dec 2 15:56:21 1998 Date: Tue, 1 Dec 1998 10:50:04 -0800 (PST) From: Steve VanDevender To: "Irene A. Shilikhina" Subject: System paralysed due to "Unable to obtain requested swap space" If you have a very small swap partition, you should use "lazy" swapping instead of "conservative" swapping. "Conservative" swapping reserves swap space for the full virtual address space of each process, even if the process does not swap pages out. "Lazy" swapping only allocates swap space for pages that are swapped out, and also tends to perform better on a busy machine. You can remove or rename the /sbin/swapdefault symbolic link, then reboot, to change from conservative to lazy swap mode. ***************************************************************************= *** On Tue, 1 Dec 1998, Irene A. Shilikhina wrote: >=20 > This morning when I came to my Alpha a bitter surprise was waiting for me= ... > At once, I noticed a particular sound produced by a disk. > All the dxconsole window was full of such messages: >=20 > Dec 1 09:01:10 alpha vmunix: swap space below 10 percent free > Dec 1 09:01:11 alpha vmunix: Unable to obtain requested swap space >=20 > (I have to tell at once that we have an immediate swap mode since our=20 > only swap partition is 160 Mbytes). >=20 > I wasn't able to get a prompt in my DECterm but at last managed to log in= =20 > from an alphabetical terminal, take a look at the processes requiring the > system resources most and execute "su" (though it was awful!). Neverthele= ss, > I FAILED in trying to kill any of these processes having got nothing but > these messages plus another one: >=20 > Dec 1 09:17:11 alpha vmunix: fork/procdup: task_create failed. Code: 0x6 >=20 > I struggled against the situation for around 20 mins but to no avail...= =20 > Nothing remained for me (in my understanding) but a drastic step - trying > sync (without success either) and ... pressing Off switch... >=20 > For THIS TIME, the things have settled without losses though I'm consciou= s of > all possible damage as result of such an act, while I'd like to keep out = of=20 > danger. >=20 > My analysis showed the user whose activity was the direct source of the= =20 > trouble - the time of the first system messages is coincident with starti= ng > (last night!) a number of copies of a computation task requiring great=20 > resources. (I've already had a conversation with him instructing to do=20 > the polite with respect to the system...) Well, what warries me much more > is what I can do to avoid such things. For the moment, we cannot afford= =20 > additional swap partition. So, I have two questions: >=20 > - why didn't the system refuse the first task having created troubles wi= th > swap space (immediate mode!) or didn't drop any process itself in such=20 > situation? According to time stamps, the problem arose in starting the=20 > first program;=20 > - how can I avoid it in the future? >=20 > Additional information: > DU 3.2c and DEC 2000 model 300 (yes, they are old, I know). >=20 > Thanks, > Irene >=20 > P.S. Of course, I know meaning of all these messages, and it's not the fi= rst=20 > time that we experience the deficiency of swap space, but the matter is= =20 > why it came to a clinch.