lzs45 发表于 2011-12-23 03:46

hp-ux内存不足导致间歇性Oracle访问缓慢ssh主机无响应

<DIV>下午客户反映管理后台无法登录,其它连接数据库的应用也反应缓慢。</DIV>
<DIV>ssh登录DB时等一两分钟才出输入密码提示,登录成功后系统反应迟钝,cpu使用率不高,但vhand进程cpu占用很高,swapinfo显示内存使用正常</DIV>
<DIV>$ /usr/sbin/swapinfo<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kb&nbsp;&nbsp; PCT&nbsp; START/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Kb<BR>TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AVAIL&nbsp;&nbsp;&nbsp; USED&nbsp;&nbsp;&nbsp; FREE&nbsp; USED&nbsp;&nbsp; LIMIT RESERVE&nbsp; PRI&nbsp; NAME<BR>dev&nbsp;&nbsp;&nbsp;&nbsp; 8388608 3640072 4748536&nbsp;&nbsp; 43%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp; 1&nbsp; /dev/vg00/lvol2<BR>reserve&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - 4743460 -4743460<BR>memory&nbsp; 15926556 4412752 11513804&nbsp;&nbsp; 28%</DIV>
<DIV>查询原因无果,查询过程中自动恢复正常,观察之。</DIV>
<DIV>&nbsp;</DIV>
<DIV>第二天上午又重现昨天问题,10分钟后自行恢复。DB 16G内存,SGA分配了6G,SWAP 8G,起始怀疑SWAP太小引起的问题,联系HP工程师给了kmeminfo工具安装之,结果如下:</DIV>
<DIV>&nbsp;</DIV>
<DIV>Physical memory usage summary (in page/byte/percent):<BR>Physical memory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 4186439&nbsp;&nbsp; 16.0g 100%&nbsp; <BR>Free memory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; 15401&nbsp;&nbsp; 60.2m&nbsp;&nbsp; 0%&nbsp; <BR>User processes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 1577435&nbsp;&nbsp;&nbsp; 6.0g&nbsp; 38%&nbsp; details with -user<BR>System&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 832501&nbsp;&nbsp;&nbsp; 3.2g&nbsp; 20%&nbsp; <BR>&nbsp; Kernel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 832331&nbsp;&nbsp;&nbsp; 3.2g&nbsp; 20%&nbsp; kernel text and data<BR>&nbsp;&nbsp;&nbsp; Dynamic Arenas&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 466094&nbsp;&nbsp;&nbsp; 1.8g&nbsp; 11%&nbsp; details with -arena<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; btree_chunk_are =&nbsp;&nbsp;&nbsp; 66250&nbsp; 258.8m&nbsp;&nbsp; 2%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vx_global_kmcac =&nbsp;&nbsp;&nbsp; 43267&nbsp; 169.0m&nbsp;&nbsp; 1%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spinlock_arena&nbsp; =&nbsp;&nbsp;&nbsp; 36163&nbsp; 141.3m&nbsp;&nbsp; 1%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg_fixed_arena =&nbsp;&nbsp;&nbsp; 29941&nbsp; 117.0m&nbsp;&nbsp; 1%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FCACHE_ARENA&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; 26879&nbsp; 105.0m&nbsp;&nbsp; 1%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Other arenas&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 263594&nbsp;&nbsp;&nbsp; 1.0g&nbsp;&nbsp; 6%&nbsp; details with -arena<BR>&nbsp;&nbsp;&nbsp; Super page pool&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; 32213&nbsp; 125.8m&nbsp;&nbsp; 1%&nbsp; details with -kas<BR>&nbsp;&nbsp;&nbsp; Static Tables&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 260179 1016.3m&nbsp;&nbsp; 6%&nbsp; details with -static<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pfdat&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; 204415&nbsp; 798.5m&nbsp;&nbsp; 5%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vhpt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; 32768&nbsp; 128.0m&nbsp;&nbsp; 1%&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; 11720&nbsp;&nbsp; 45.8m&nbsp;&nbsp; 0%&nbsp; vmunix text section<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bss&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp; 6844&nbsp;&nbsp; 26.7m&nbsp;&nbsp; 0%&nbsp; vmunix bss section<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp; 2026&nbsp;&nbsp;&nbsp; 7.9m&nbsp;&nbsp; 0%&nbsp; vmunix data section<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Other tables&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp; 2404&nbsp;&nbsp;&nbsp; 9.4m&nbsp;&nbsp; 0%&nbsp; details with -static<BR>&nbsp; Buffer cache&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 170&nbsp; 680.0k&nbsp;&nbsp; 0%&nbsp; details with -bufcache<BR>&nbsp; UFC file mrg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 1694779&nbsp;&nbsp;&nbsp; 6.5g&nbsp; 40%&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>HP工程师结论是物理内存占用完导致系统持续vhand,建议:</DIV>
<DIV>1、加大物理内存</DIV>
<DIV>2、改小SGA</DIV>
<DIV>3、调整UFC(默认物理内存5%~50%)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>====================相关话题====================</DIV>
<DIV><a href="http://www.itpub.net/thread-1345729-1-1.html" target="_blank">http://www.itpub.net/thread-1345729-1-1.html</A></DIV>
<DIV>客户反映一台32G的HP-UX经常swap,但,分给Oracle的SGA+PGA内存仅仅23个G,并且,该机器上没有跑其他的应用,理论上不应该导致交换。<BR><BR>glance了一下:<BR><BR>发现FileCache占用了8.3Gb的内存,导致了内存交换。<BR><BR>对于HP-UX 11i Version 3,可以修改初始化参数filecache_max来控制FileCache占总内存的百分比<BR><BR><A href="http://docs.hp.com/en/B2355-60130/filecache_max.5.html" target=_blank><FONT color=#336699>http://docs.hp.com/en/B2355-60130/filecache_max.5.html</FONT></A><BR><BR>NAME<BR>filecache_max, filecache_min — maximum or minimum amount of physical memory used for caching file I/O data<BR><BR>VALUES<BR><BR>Failsafe<BR>filecache_min: approximately 5% of physical memory<BR><BR>filecache_max: approximately 5% of physical memory<BR><BR>Default<BR>filecache_min: approximately 5% of physical memory<BR><BR>filecache_max: approximately 50% of physical memory<BR><BR>The defaults are computed and adjusted automatically, based on the amount physical memory on the system.<BR><BR>The current default value, when displayed by kctune, will be expressed as the current value used internally by the system (representing bytes). The displayed value will vary as the internal value is automatically adjusted.<BR><BR>Allowed values<BR>Minimum filecache_min: not less than the equivalent of 1 megabyte<BR><BR>Minimum filecache_max: not less than the equivalent of 1 megabyte<BR><BR>Maximum filecache_min: not greater than the equivalent of 70% of physical memory<BR><BR>Maximum filecache_max: not greater than the equivalent of 90% of physical memory<BR><BR>See Restrictions on Changing below.<BR><BR>Values can be specified as:<BR><BR>1) Default<BR><BR>2) A percentage of total physical memory:<BR>A positive whole number followed by a percent symbol (for example, 70%).<BR><BR>3) A constant value:<BR>A positive whole number that represents number of bytes of physical memory, optionally followed by a multiplier suffix, where K=1000, KB=1024, M=1000000, MB=(1024*1024), and GB=(1024*1024*1024).<BR><BR><BR>Recommended values<BR>It is recommended that these tunables are left in the automatic (default) state, to allow the system to better balance the memory usage among filesystem I/O-intensive processes and other types of processes.<BR><BR>DESCRIPTION<BR>These tunables control the amount of physical memory that can be used for caching file data during file system I/O operations.<BR><BR>The amount of physical memory that is specified by the filecache_min tunable is reserved and guaranteed to be available for file caching.<BR><BR>The amount of physical memory used for file caching can grow beyond filecache_min, up to filecache_max, depending on I/O load and competing requests for physical memory.<BR><BR>When these tunables are set to default, or set to a percent value, they automatically adjust with Online Addition or Deletion (OL*) of physical memory, as appropriate.<BR><BR>Who Is Expected to Change These Tunables?<BR><BR>The automatic (default) state should be appropriate for most environments.<BR><BR>You must set these tunables to a constant value (not default or percent) if you want to specify file cache limits with finer granularity than percent of physical memory (for example, a minimum size or fixed size of &lt;1% of physical memory).<BR><BR>You must set these tunables to a constant value (not default or percent) if you do not want the limits of the file cache to adjust with OL* of physical memory.<BR><BR>To discriminate in favor of deterministic I/O on systems with large file I/O activity, or on the contrary, to discriminate in favor of better performance of non-I/O-intensive processes, you can consider changing the values of these tunables, keeping in mind the side effects as described below.<BR><BR>To determine a reasonable value for the cache size you should consider the file I/O-intensive applications on your system, and the size of their working set. Depending on the type of applications, the working set size can be based on the size of a transaction, or data size in given unit of time. For example, for a conservative value of filecache_min in megabytes, you can use the following formula: <BR><BR>MB = number-of-system-processes * largest-application-record-length-in-MB * number-of-records-in-working-set <BR><BR><BR>Only those processes that actively use disk I/O for file data should be included in the calculation. All others can be excluded. Here are some examples of what processes should be included in or excluded from the calculation. <BR><BR>Include: <BR>NFS daemons, text formatters, database management applications, text editors, compilers, and so on, that access or use source and/or output files stored in one or more file systems mounted on the system.<BR><BR>Exclude: <BR>X-display applications, hpterm, rlogin, login shells, system daemons, telnet or uucp connections, and so on. These processes use very little, if any, disk I/O for file data.<BR><BR><BR>Restrictions on Changing<BR>These tunables are dynamic and automatic.<BR><BR>The system rounds the specified tunable value(s) down to the closest physical page boundary.<BR><BR>The amount of physical memory represented by filecache_min must be equal to or less than the memory represented by tunable filecache_max.<BR><BR>Setting these tunables to a constant value will de-couple them from OL* events.<BR><BR>Tuning up of the filecache_min parameter may fail if there is not enough free physical memory to satisfy the request.<BR><BR>These tunables, filecache_min and filecache_max, must both be set to a relative state (either default of percent state), or must both be set to a constant value. For example, the following are acceptable settings:<BR><BR># kctune filecache_min=100MB filecache_max=100MB<BR><BR># kctune filecache_min=15% filecache_max=65%<BR><BR># kctune filecache_min=Default filecache_max=65%<BR><BR>The following will result in an error:<BR><BR># kctune filecache_min=10% filecache_max=1GB<BR><BR>ERROR: The specified units for the values of filecache_min and filecache must be consistent: both as relative (percentage or default) or both as constant value.<BR><BR>If filecache_min is currently set to default, the following is acceptable:<BR><BR># kctune filecache_max=Default<BR><BR># kctune filecache_max=40%<BR><BR>But the following will result in an error:<BR><BR># kctune filecache_max=1GB<BR><BR>See other restrictions in the Allowed values section above.<BR><BR>When Should the Value of These Tunables Be Raised?<BR>Low system performance at initialization time and/or on a system with filesystem I/O-intensive processes may be an indication that the values of these tunables are too low. If there is a large number of processes actively and constantly using file data I/O, you should raise the value of filecache_min for more deterministic I/O. In most cases, especially when the file data I/O is expected to peak only occasionally, it is recommended that the value of the maximum limit, filecache_max, is raised instead.<BR><BR><BR>What Are the Side Effects of Raising the Values?<BR>The amount of memory reserved for the minimum file cache size, dictated by filecache_min, cannot be used on the system for other purposes. Be careful not to raise this value so high that it can eventually cause memory pressure and overall system performance degradation.<BR><BR>When Should the Values of These Tunables Be Lowered?<BR>The value of the minimum limit, filecache_min, can be lowered to allow a larger percentage of memory to be used for purposes other than filesystem I/O caching, depending on competing requests. By lowering the value of filecache_max, a larger amount of memory is available for other purposes, without competing with file I/O requests.<BR><BR>What Are the Side Effects of Lowering the Values?<BR>If there are many competing requests for physical memory, and the file cache tunables are set to too low a value, very high demand on file I/O operations can eventually cause filesystem I/O performance degradation.<BR><BR>EXAMPLES<BR>Set the file cache minimum to 10% of physical memory:<BR><BR># kctune filecache_min=10%<BR><BR>Set a fixed size file cache of 1 gigabyte:<BR><BR># kctune filecache_min=1GB filecache_max=1GB<BR><BR>Set the file cache minimum to 15% of physical memory, and the maximum to 65% of the physical memory:<BR><BR># kctune filecache_min=15% filecache_max=65%<BR><BR>WARNINGS<BR>All HP-UX kernel tunable parameters are release specific. These parameters may be removed or have their meaning changed in future releases of HP-UX.<BR><BR>Other tunable parameters related to sizing the buffer cache that existed in previous HP-UX releases are now obsolete. The tunables filecache_min and filecache_max should be used to set limits to the file cache. Note that, on any given system, the optimum values of these two new tunables are not necessarily equivalent to the optimum values of the obsolete tunable values in the older systems. You should first determine if the new default values yield acceptable performance on your system, before attempting to change the values of the new file cache tunables.<BR><BR>Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tunable values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see HP-UX Release Notes at <A href="http://docs.hp.com./" target=_blank><FONT color=#336699>http://docs.hp.com.</FONT></A><BR><BR>AUTHOR<BR>filecache_max and filecache_min were developed by HP.</DIV>
页: [1]
查看完整版本: hp-ux内存不足导致间歇性Oracle访问缓慢ssh主机无响应