From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079072816202.tru64-unix-managers.marc@archive.invalid> From: "Hibberd, Jeremy" Date: Wed, 22 Sep 1999 00:34:14 +0000 To: tru64-unix-managers Subject: SUMMARY : System freeze - memory bottleneck X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079072816202 MIME-Version: 1 Content-Type: multipart/mixed; boundary="------_=_NextPart_000_01BF0492.37270586" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01BF0492.37270586 Content-Type: text/plain; charset="iso-8859-1" Good day to all. Well I received some very quick, thorough and helpful replies from a number of people. To them I give much thanks, they are : Martin Dusek Kevin S. Partin Marco Luchini Alan Davis Dr. Thomas P. Blinn Dr PH Ng Bruce Kelly alan@nabeth Well, since performance tuning is a dark and unpredictable science the responses were somewhat varied. I have attached a file with all replies and recommendations I received for any who are interested. Having identified which kernel parameters are possibly the cause, our approach will be to change a few at a time and observe system behaviour. The first three we are changing to be more suitable for a larger memory system ( ours are currently set at default )are as per Martin Dusek's excellent and thorough advice : ....default UNIX kernel memory parameters are unusable with large memory usage. Main reasons: 1. system begins to page when the number of free pages gets under vm-page-free-target (default 128), but this paging is very "slow" - not aggresive and it cannot keep pace with memory demands. So free pages get immediately under vm-page-free-min 2. under vm-page-free-min (default 20) the paging becomes very aggressive but it is too late. Free memory otfen reaches vm-page-free-reserved 3. under vm-page-free-reserved (default 10) only privileged tasks cen get memory until it is freed Also have been in contact with Compaq technical support, they have come up with a very good and relevant document "Hang: Avoiding System Hangs Due to Low Free Memory Pages " which I have attched. The information within basically supports changes to kernel parameters as per Martin's recommendation and also gives suggested values. Hopefully these changes will solve the problem ( we will also be adding more memory at some point as well ) - if they do not I will try some other parameters and post changes and results. Thankyou again to all. Cheers Jeremy Hibberd -----Original Message----- From: Hibberd, Jeremy Sent: Thursday, September 16, 1999 10:42 PM To: tru64-unix-managers@ornl.gov Subject: System freeze - memory bottleneck Hello All. Been monitoring this list for some time, never posted before so here goes. We have a Trucluster (v 1.5) system comprising two AS8400 5/625 systems running Tru64 V4.0D each with 4GB memory and 12GB swap. They are running Sap R3 v4.0B ( patch level ) with an Oracle database ( v 8.0.4 ). From time to time ( every few days ) if a large report gets generated ( ie 1GB ) we see a memory bottleneck ( vmstat ) with a high rise in page outs ( basically from 0 up to > 10K ). It is at this point that the system "freezes" for up to 25 minutes - no-one can login can't even get system console. During this time nothing gets logged by any processes - we have vmstat and iostat cron jobs running every 5 minutes, system monitoring with patrol - all logs show last entry just prior to the freeze and start logging again just after the system unfreezes. As such we are a bit in the dark as to what actually happens during the freeze. Other resources seem fine during the freeze - memory paging is the only one that goes through the roof. Things are getting a bit hot regarding this issue and I would really appreciate anyone's opinions/thoughts/abuse/anything..... Thanks in advance Jeremy PS - Sorry if I have missed anything etc... Give ma a yell if I can provide anything - stats etc. ------_=_NextPart_000_01BF0492.37270586 Content-Type: text/html; name="v40d-tune.html" Content-Disposition: attachment; filename="v40d-tune.html" [UNIX ] Hang: Avoiding System Hangs Due to Low Free Memory Pages

[UNIX ] Hang: Avoiding System Hangs Due to Low Free Memory Pages

COMPONENT : Tuning

VERSION : 4.0D (with or without patch-kits #1, #2 or #3)

OPERATING SYSTEM OR PRODUCT NAME : Compaq Tru64 UNIX

:

PROBLEM :

A system running Compaq's Tru64 Unix, version 4.0D (with or 
without patch-kits #1, #2 or #3) could hang due to a low 
vm_page_free_count.  This is particularly likely to happen 
when the vm_page_free_count falls below 10.

ANALYSIS :

When the system load is heavy, with a low amount of free memory 
pages and a large number of processes contending for memory/RAM
resources, the system starts paging or at worst swapping to 
recover some additional memory pages. 

In the "Digital Unix  - System Tuning and Performance Management" 
guide for version 4.0D, it states that sometimes a system is unable 
to recover any pages once the  vm_page_free_count falls below 10 
(the default setting for the kernel parameter vm-page-free-reserved).

This low memory condition could prevail for longer times thus 
looking like a hung condition. Though the system may recover 
eventually, we may never know how long this could be.

Often on a forced crash, we can look for such condition as follows:

dbx -k vmunix.# vmcore.#
(dbx) pd vm_page_free_count
9  
     (OR)

(dbx) pd vm_perfsum.vpf_freepages
9

SOLUTION :

The vm-page kernel parameters can be configured to prevent the
Unix 4.0D system from getting into such a low free memory condition
thus preventing a potential hang. Different systems with different
loads may need these parameters to be configured with higher values,
but the following parameters and suggested values can be used
as a starting point.

These kernel parameters belong to vm: sub-section of the
file /etc/sysconfigtab 

vm:
vm-page-free-target = 512
vm-page-free-swap = 128
vm-page-free-min = 128
vm-page-free-reserved = 64
vm-page-free-optimal = 256


The default settings for these parameters are:

vm:
vm-page-free-target = 128
vm-page-free-swap = 74
vm-page-free-min = 20
vm-page-free-reserved = 10
vm-page-free-optimal = 74

Explanation and more information about these parameters can be 
obtained from the System Tuning and Performance Management Guide
for Unix.

RESOURCES : System Tuning and Performance Management Guide

\Author : 326695

\Tech Reviewer : 152933

\Edit Reviewer : 117864

UX-19990225135815
Most recently modified Fri Apr 30 11:15:24 EDT 1999 by linda.downing@compaq.com (117864)
------_=_NextPart_000_01BF0492.37270586 Content-Type: text/plain; name="SUMMARY System freeze - memory bottleneck.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="SUMMARY System freeze - memory bottleneck.txt" From: Martin.Dusek@pregis.cz Sent: Friday, September 17, 1999 12:09 AM To: Hibberd, Jeremy Subject: RE: System freeze - memory bottleneck Hi Jeremy we have similar configuration, i.e. Tru64 V4.0D, TruCluster v1.5 with two AS4100 5/600 with 4GB memory, SAP R/3 3.0F, oracle 7.3.4 and=20 later 8.0.5. We had hard problems with lack of memory, system very often "hanged". There were two main problems: First, everything nearly hanged during generation of huge files as core dumps or adding datafile to a tablespace. Nevertheless system doestn't fully freeze in these situations so we don't solve = this. Second, default UNIX kernel memory parameters are unusable with large memory usage. Main reasons: 1. system begins to page when the number of free pages gets = under vm-page-free-target (default 128), but this paging is very "slow" - not aggresive and it cannot keep pace with memory demands. So free pages get immediately under vm-page-free-min 2. under vm-page-free-min (default 20) the paging becomes very aggressive but it is too late. Free memory otfen reaches=20 vm-page-free-reserved 3. under vm-page-free-reserved (default 10) only privileged = tasks cen get memory until it is freed Another problem is with swapping - you should never allow that SAP workprocesses are outswapped because it terribly increases response = time (in transaction st03 you can see wait times in hundreds of = miliseconds). You should set the memory parameters so as free memory is reached by paging and not by swapping. Swapping is possible only for tasks which are launched in the morning but then are sleeping all the time. This is not the case of oracle processes os SAP workprocesses: dw.sapPP0_DVEBMGS02 pf=3D/usr/sap/PP0/SY... oraclePP0 (DESCRIPTI... So now other reasons of memory problems: 4. further, when free pages go under vm-page-free-swap (default 74), the "soft" swap begins - system outswaps all tasks that have been idle for 30 seconds or more. It is not the worse problem as mentioned above. But! 5. when free pages go under vm-page-free-optimal (default 74, = the same as vm-page-free-swap - don't ask me why. It does't give any sense) the hard swapping begins - so your SAP=20 workprocesses are doing nothing else than moving down and up between memory and swap disks. Typicall you can see hundreds or thousands page outs in vmstat. Solution? Increase vm-page-free-target so as the VM system has anough time to free nonactive pages. Increase vm-page-free-min so the system has=20 enough time to free memory by aggressive paging and never (NEVER!!) = goes under vm-page-free-reserved. Increase vm-page-free-swap but set it much lower than vm-page-free-target so as the system first pages, than swaps. Set vm-page-free-swap higher than vm-page-free-optimal so as the hardswap "never" begins but the soft swap is possible (long idle tasks can be outswapped). It is on you if you allow idle task swapping or = not. In my parameters the swapping never (or nearly never) begins because vm-page-free-min=3D192 and vm-page-free-swap=3D128. You can change = this. How to do it? Create file /etc/sapr3.stanza.vm with contents: vm: vm-page-prewrite-target=3D384 vm-page-free-target=3D512 vm-page-free-min=3D192 vm-page-free-swap=3D128 vm-page-free-optimal=3D74 vm-page-free-hardswap=3D2048 cd /etc sysconfig -m -f ./sapr3.stanza.vm Then I relinked the kernel by doconfig but I'm not sure if it is necessary. Perhaps rebooting the system could be enough. Dont' be afraid to increase all parameters mush more. Mr. Kejzlar from Pilsen University has set the limits to thousands and it works. You can find a good manual at: http://www.unix.digital.com/faqs/publications/base_doc/DOCUMENTATION/V40= D_HTML/V40D_HTML/AQ0R3FTE/CHVMXXXX.HTM Regards, Martin _______________________________________________ Martin Dusek martin.dusek@pregis.cz IT BC departement manager tel: +420-428-359571 PREGIS a.s., Smetanova 45 +420-602-437235 46621 Jablonec nad Nisou fax: +420-428-317844 Czech Republic =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D From: Partin, Kevin S [Kevin.Partin@SW.Boeing.com] Sent: Friday, September 17, 1999 6:37 AM To: Hibberd, Jeremy Subject: RE: System freeze - memory bottleneck I have seen this problem on a PW433au running 4.0D. What is happening = is that all of the swap space is being used up. Once the machine runs out = of swap space, it will 'freeze' until the process causing the problem = finishes or crashes. The 'freeze' is the machine not being able get any free = memory pages. You are probably running with strict swap allocation. In = reality, you are probably not using any, or much, swap space, but the strict = allocation policy will allocate all swap space even though nothing is swapping. In my situation, it was a very badly behaving X-Window application, = with a huge memory requirement, that caused by system to freeze. Kevin ------------------------------------------ Kevin S. Partin The Boeing Company 13100 Space Center Blvd. Mail Code: JHOU-2230 Houston, TX 77059 Phone: 281-244-4088 Pager: 713-549-0713 Facsimile: 281-244-4984 Email: mailto:kevin.s.partin@boeing.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D One really needs to take a look at your sysconfigtab settings. If you = are using defaults, I would guess that that the large report uses up all = the UBC. This forces out all the other processes. As Oracle is using = shared memory segments they all get swapped out and nothing can run. It's = amazing you can't even get a login shell though. It definitely sounds as if = you are getting thrashing of the UBC. Take a look at your ubc settings and the section on memory tuning on the system and admin guide under http://www.unix.digital.com. You might want to monitor the UBC with dbx = -k /vmunix /dev/mem from a high priority root shell. That should help get output while the problem is occurring. Marco Marco Luchini Unix support Acco-UK =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D From: Davis, Alan [Davis@Tessco.Com] Sent: Friday, September 17, 1999 6:23 AM To: Hibberd, Jeremy Subject: RE: System freeze - memory bottleneck Without more performance info it's hard to tell, but my first guess is = that you should look at vm parameter ubc-maxpercent and related parameters. This type of freeze can be seen when a single process takes the = majority of physical ram for i/o buffering. By reducing ubc-maxpercent you limit the amount of ram stolen by i/o = buffers and keep enough memory to run the other processes. Alan Davis =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D You don't have enough physical memory for your workload when the large = report is running. Once it starts running and hogging all available physical = memory all the pages for everything else in user space quickly gets paged out, = and in particular all the presently inactive stuff gets paged out. Once that = happens it's extremely unlikely that anything will get paged in enough to = actually run for long until the hog goes away. You need to tune the system to limit the working set of this huge = application or you need to get more physical memory. Buying more memory may turn = out to be both easier in the short run and cheaper in the long run; attempting = to tune a multi-user system to deliver good performance when it has to = also work with very demanding applications is a thankless and hopeless task. Tom =20 Dr. Thomas P. Blinn + UNIX Software Group + Compaq Computer = Corporation 110 Spit Brook Road, MS ZKO3-2/W17 Nashua, New Hampshire 03062-2698 Technology Partnership Engineering Phone: (603) 884-0646 Internet: tpb@zk3.dec.com Digital's Easynet: alpha::tpb ACM Member: tpblinn@acm.org PC@Home: tom@felines.mv.net =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D From: alan@nabeth.cxo.dec.com Sent: Friday, September 17, 1999 10:09 AM To: Hibberd, Jeremy Subject: Re: System freeze - memory bottleneck=20 The report generation is probably doing a lot of sequential I/O, which causes the file system to go into read-ahead mode. This quickly fills the buffer cache with data from the file being read, and flushes most everything else out. Dirty data will be written, may cause a short burst of I/O. Since the buffer cache uses the same memory as the processes, the kernel will try to free up more memory for the cache, which causes the high paging load. Part of the freeze is probably related the high I/O load. If you're using a small number of medium speed devices for the page/swap space, it can take a long time to page a few GB of memory. If the Oracle data space is pagable, it is probably a good candidate for paging out. Paging it back will when the report is through the file(s), will be another long I/O load. You might try running sys_check to see if can offer any advise on how to tune the virtual memory subsystem. The V4.0D documentation should have a tuning guide that can help explain what the suggestions are doing. ------_=_NextPart_000_01BF0492.37270586--