1833784 Members
2862 Online
110063 Solutions
New Discussion

Re: More swap needed?

 
Paul Hawkins
Frequent Advisor

More swap needed?

Hello,
I've got the feeling that my server needs more swap...
Memory utilisation is consistantly at 99%-100%.
Swap is around 75% utilised.
I have 8GB memory deployed in N-Class.
In glance, the Sys Mem is shown as being 6.24 GB, this seems too much...
Would adding more swap space reduce the total memory utilisation. BTW, I reduced the dbc_max_pct to 10% so I would expect the buffer cache to be around 800 mb - again, in glance, buffer cache shows at being only 580 mb.
Running 11i....

Thanks in advance.
(Points will be assigned!)
Paul
11 REPLIES 11
David_246
Trusted Contributor

Re: More swap needed?

Hi Paul,

Using swapinfo you can get some memory info as well. I use the attached script to see what actualy got claimed and what got used.

In the script you can grep for "oracle" and then count, etc, etc.

But using 8 Gb of memory is quiet a lot. Is swap realy used ? (sar -d 5 20) if so this is very bad performing for your machine. I'dd definitly try to spread the load over more machines if I were you. Increase memory ?? Increase CPU ??
I don't know if this will solve all your problems.

Regs David
@yourservice
Stefan Farrelly
Honored Contributor

Re: More swap needed?

If swap if showing 75% used (and its size is 8GB) then you are severely short of memory. Things to do are;

1. ensure device swap is set to the same size as physical ram (8Gb) or else you may not be able to use all 8Gb of ram for processes.
2. reduce buffer cache to 300Mb (dbc_max_pct to 4%) - any more than this causes an overhead on the operating system.
3. sys memory being 6.24 GB is ok if you have a large database using shared memory. However, as you are so short of memory get the DBA's to reduce the size of shared memory as by having it so large (over 6Gb) and the server is now severely swapping, its only making the server slow down. If they reduce the shared memory size the server will speed up.
4. add more ram.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Pete Randall
Outstanding Contributor

Re: More swap needed?

The short answer:

Sounds like you need more memory not more swap.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: More swap needed?

Conventional rules which I learned from HP are swap should be twice memory. I can't find where you state your actual swap size.

But Stephen is right, the real issue is you need more memory.

Oracle is a hungry, hungry, HUNGRY database with great power. It hungers for memory. Forgive the characterization, but it seems you can never have enough memory for it.

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
Bill Hassell
Honored Contributor

Re: More swap needed?

In case users or DBAs are complaining about performance, you can verify once and for all that you have too little RAM. Run vmstat and look at the po (page out) column. If it is 2 or more digits, then your programs are being swapped like crazy and swapping creates a 100:1 (or worse) performance penalty for active programs.

Double your RAM and reduce you buffer cache to 300-800 megs using SAM and the dbc max percentage value (will need a reboot). As far as the swap=2xRAM formula, that was from another century...today's systems are asked to do massive amounts of work as quickly as possible, so you would normally order enough RAM to keep everything in RAM during normal operations. the default setting is to allow up to 75% of processes in RAM to remain there without a corresponding reserve area (just in case) in swap. Thus, the total amount of memory available to all processes is swap + 0.75xRAM.

But since swapping is so terrible for performance, eliminate the problem by simply doubling RAM. Pricey? Well, how importrant is the performance of this server? You can also stop running so many programs and have the DBAs cut down the size of any shared memoryy areas.


Bill Hassell, sysadmin
keith persons
Valued Contributor

Re: More swap needed?

Hmm, I have one question - what do you have maxswapchunks set to?

keith
Patrick Wallek
Honored Contributor

Re: More swap needed?

Post the output of the 'swapinfo -tam' command please. I am curious to see if you are really swapping or if you just have a lot reserved for processes.
Paul Hawkins
Frequent Advisor

Re: More swap needed?

Hi,
Some more info...

Results of swapinfo -tam
=========================
swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 617 3479 15% 0 - 1 /dev/vg00/lvol2
reserve - 1370 -1370
memory 6331 6105 226 96%
total 10427 8092 2335 78% - 0 -

Maxswapchunks = 2048


The swap device is 4GB

We are running Oracle Apps 11i

Nobody has complained about poor performance but I am concerned about the amount of memory that SYS procs are using (over 6GB!) as displayed by Glance. Im aware of the differences in 11i on the way that sys memory is reported but 6GB.....

Thanks Guys

Sridhar Bhaskarla
Honored Contributor

Re: More swap needed?

Hi Paul,

96% utilization in the memory field of your swapinfo -t does not mean your physical memory utilization is 96%. The 'memory' figure in your swapinfo -t represents only the memory that was alloted for swap reservation purposes. However, it is a good indication of the memory utilization though.

You can believe your glance data.

Also looking at your swapinfo, there is 617MB sitting on swap. Means your system is paging out.

Look at your 'vmstat' output and see if 'po' is a substantial number. Also look at glance's memory window and see if the Page Outs are happening regularly in large numbers. Deactivations and Reactivations are next level and indicate a severe memory pressure.

If that is the case, you will need to add more physical memory. That will increase your swap space too as you have swapmem_on enabled. But it is a good idea to add little more device swap and make it's priority to 0 so that you won't impact your root disk.

-Sri



You may be disappointed if you fail, but you are doomed if you don't try
keith persons
Valued Contributor

Re: More swap needed?

Paul,

6gb+ for system processes!!!! You are correct, that is way, way too much for sys procs - and the worst part is the kernel must manage these values. Before you start throwing memory or swap at this I would suggest trying to find out why the kernel is consuming so much memory - it should not consume this much for any reason that I can recall. Your system may require it, but I cannot think of a reason why 80% of physical memory would be allocated to system - if it can be reduced I think things will change, at least regarding memory, considerably.

Keith
Paul Hawkins
Frequent Advisor

Re: More swap needed?

I think I've sussed it.
Using perfview I could see that the SYS portion of used memory was increasing every day. From about 20% up to about 80% now...
Using PV I could see the jump in usage at the same time each night. I identified a cronjob that runs at this time - this cron job does lots of unix housekeeping stuff - takes a few minutes to run. Problem is, the memory it uses is not released - memory leak...
Im going to try to identify what it is in this script that is causing the problem but Im guessing the patch level of this server is the real culprit.
Thanks for your help.
Paul