Operating System - HP-UX
1834435 Members
2304 Online
110067 Solutions
New Discussion

10.20 server with possible memory / swap problems?

 
Phil Janes_1
Occasional Contributor

10.20 server with possible memory / swap problems?

Hi all,

We have a 10.20 server that is reported to have memory problems.

We can't run glance so I've tried a few other things:-

swapinfo says:-

# swapinfo -mat
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 512 0 512 0% 0 - 1 /dev/vg00/lvol2
dev 2000 0 2000 0% 0 - 1 /dev/vg00/lvol4
reserve - 2399 -2399
total 2512 2399 113 96% - 0 -


Am I right in thinking that the "reserve" indicates that virtually all the swap space has been pre-allocated for processes and therefore there may not be any available?

vmstat output says:-

procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
0 0 0 84512 227921 2 2 0 0 0 0 0 853 1522 457 2 1 97
0 0 0 84512 227891 1 0 0 0 0 0 0 734 1056 315 0 0 99
0 0 0 84518 227891 0 0 0 0 0 0 0 726 942 305 0 0 100
0 0 0 84518 227891 0 0 0 0 0 0 0 721 973 301 0 1 99
0 0 0 83987 227891 0 0 0 0 0 0 0 717 899 307 0 1 99
0 0 0 83816 227875 0 0 0 0 0 0 0 720 941 310 0 0 99
0 0 0 83816 227875 0 0 0 0 0 0 0 715 997 301 0 1 99
0 0 0 86152 227875 0 0 0 0 0 0 0 714 924 300 0 0 100
0 0 0 86152 227875 0 0 0 0 0 0 0 713 968 298 1 1 99
0 0 0 86105 227875 0 0 0 0 0 0 0 712 895 296 0 1 99

Correct me if I'm wrong but this looks like we have approx 900mb free memory (4*227875).

"top" says:-

Load averages: 0.08, 0.08, 0.08
525 processes: 523 sleeping, 1 running, 1 zombie
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.00 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
1 0.09 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
2 0.12 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
3 0.10 1.0% 0.0% 0.0% 99.0% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.08 1.0% 0.0% 0.0% 99.0% 0.0% 0.0% 0.0% 0.0%

Memory: 869372K (787540K) real, 386204K (340016K) virtual, 911348K free Page# 1/19

The memory and virtual memory figures seem to tally with vmstat.

It looks like we have enough free memory.

So - my concern is around the output from swapinfo. We have 4gb physical memory. I guess the 2.5gb of swap could be a little low since (from what I can gather) we should have 2 or 2.5 times phys memory.

If anyone has any comments / tips / feedback - that would be great.

Cheers,

Phil.
5 REPLIES 5
Ralf Seefeldt
Valued Contributor

Re: 10.20 server with possible memory / swap problems?

Hello Phil,

Your interpretation of the values seems OK.

using 2 to 2.5 times the physical memory as swap seems to be a bit outdated to me. This was trou as long, as you had physical memory around several dozend or few hundred MB.

You should look at your applications and figure out, how many swap they need. may be a database requires an awfull lot of them or some application requires no swap at all. If you would really constantly swap 4 to 5 GB, your system would become pretty slow.

I would start analycing and optimicing the applications. Parehaps you can install a glance trialversion, which may be used for 30 days.

Hope this helps
Ralf
Steven E. Protter
Exalted Contributor

Re: 10.20 server with possible memory / swap problems?

Shalom Phil,

I agree that having swap at 2.5 times RAM merely slows the system down.

Swap reservation is nice to know, but its not key. They key issue is whether or not processes are paging from disk to memory or back again.

The vmstat command measures this.

Page faults are not a problem, but lots of paging, high cpu times to the vhand process and such show an overloaded system that needs more memory.

The goal in todays performance management is to never page a process to disk. What I generally do for systems that are susceptiable to stress is have two swap areas. One is small, priority 0 first, usually as little as half of physical ram.

The second is larger and set to a higher priority number and is therefore less likely to be used.

I learned this methodology from the posts of A. Clay Stephenson.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Phil Janes_1
Occasional Contributor

Re: 10.20 server with possible memory / swap problems?

Thanks for the feedback guys.
Victor BERRIDGE
Honored Contributor

Re: 10.20 server with possible memory / swap problems?

Hi Phil,
From what I see you may have some memory issue for HPUX is a VM system...
This means you can load in memory as much as the sizwe of the SWAP and since your swap in 2.5 GB you have with almost 2.4GB reserved not much left...
So to be able to use (for processes) all your RAM you will have to add another 1.5GB of swap...
Is this a 32bit OS?
Then you may fall on other limitations I cant remember like that but I remembered using memory windows...


All the best
Victor
Patrick Wallek
Honored Contributor

Re: 10.20 server with possible memory / swap problems?

Victor is right...In order to fully use your 4GB of RAM you must either: 1) add another 1500 MB of SWAP space, or 2) set the swapmem_on kernel parameter to 1.

As it stands now you will only use as much RAM as you have swap, which is 2,512 MB.