Operating System - HP-UX
1834150 Members
3584 Online
110064 Solutions
New Discussion

Re: memory and swap device

 
Kathy McGohan_1
Frequent Advisor

memory and swap device

We have an Oracle database which uses Oracle version 8.1.6. System has 6 GB. of physical memory. This database is a memory hog. I do have swapmem_on set to 1. Below is an example of
swapinfo -mt.

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
dev 512 0 512 0% 0 - 1 /dev/vg00/lvolc
reserve - 1536 -1536
memory 4714 3696 1018 78%
total 6250 5232 1018 84% - 0 -

Should I create another swap device or increase the one I have? And if I do need to increase or make a new swap device, how large should it be?
I'm not sure how all this works, but I didn't think the total of this output should be so high.
Thanks in advance for your help.
7 REPLIES 7
John D. Reaney
Advisor

Re: memory and swap device

I would turn off swapmem_on = 0 (do that) let oracle manage the sga and you dont duplicate the memory.

what is your dbc_max and dbc_min - dont need to double buffer - reduce these to 2 and 10 or 5 and 10.

Or increase your device swap by 2GB.
Rita C Workman
Honored Contributor

Re: memory and swap device

Swap and memory can be so confusing...
First when you run swapinfo -tam you are seeing the total of all memory defined. But when you use other commands or utilities you see different %'s..
If you look closer you'll see you are not even paging out to device swap according to your output.
For myself I always tend to leave psuedo swap on (as you have it..). Those parms dbc_max and dbc_min, these too are confusing. The max is the max amount of mem you are reserving. The default for this is 50 which means 50% of all your memory you are reserving. That's a bit too high for me. I generally recommend setting it to something like 10max and 5 min...you can go higher, just remember, 'what you givith here...you taketh from there'. The highest I generally go on max in 20. I let pseudo swap handle it.
And bear in mind I deal with multiple Oracle instances running on a K box that only has 1.5gb memory...so I can't waste a bit of memory. We run fairly well, with only the usual complaints. I only go high on the dbc_max when I have more memory..and like I said I don't tend to go over 20 for max.
I would recommend reading everything you can get your hands on for swap and mem mgt (white papers and the like..) they're are some on /usr/share/doc.

For what it's worth,
/rcw

...Most important thing to remember, you know your server and apps better than anyone..make small changes and observe for awhile...
Kathy McGohan_1
Frequent Advisor

Re: memory and swap device

John you asked me what dbc_max is. It is 15 and
dbc_min is 5. What do you mean by double buffering?
John D. Reaney
Advisor

Re: memory and swap device

The problem is often how JFS filesystems are mounted. The key is to use the mincache=direct option when mounting the file systems. This bypasses the cache and writes directly to the disks. The write is already been buffered in the SGA, no need to buffer again. that way you can reduce your dbc_min and max (5 and 10 are fine as was stated earlier by someone).
This way oracle controls the cache - which it already has reserved in memory (SGA). If you dont do this then every write goes to the SGA (memory) and then to the dbc (memory) to write - double buffering.

NOTE: HP does not recommend cache buffer much above 200MB so if you have dbc_min and max real high you will exceed this and it is kind of wasted.

It also depends on whether you do a lot of reads or a lot of writes - the buffer cache is more help on reads but it hurts on writes. Be nice if HP would dlkm with automatic tuning through something like prm. Oh well..

Did I help or hinder?
Kathy McGohan_1
Frequent Advisor

Re: memory and swap device

Thanks, John. I will present all these options to the data base folks to see what they say.
John D. Reaney
Advisor

Re: memory and swap device

OK, good luck - I wish there was one answer but their isnt. It always depends - depends on reads/writes/GB of Ram/architecture/disk storage system.

If they are having performance problems it is more than likely due to database layout on the disks. If you stripe the data, index and rbs they tend to perform better. As for your memory display just remember that the numbers are not always right - swapinfo shows what is reserved - not actually in use. Also are you using EMC or XP or HP FC. What class server is this.

When you go to the dbas ask them
1. what does it do - is it dss or olap
2. Are you entering data or generating reports
3. outline size requirements

With memory there are a lot of things you can do - memory windows are one thing, pseudo-swap(or its disablement) is another. But I would recommend that you have at least as much device swap as memory - configure it to be swap/dump so you have someplace to dump when the system crashes - use crashinfo to set this up and verify you have enough to capture the data.

Whew, start with one simple question.....

Have a nice day - off to replace a core IO bus on an old K-class...John
John D. Reaney
Advisor

Re: memory and swap device

Another little trick - if you are using mirrodisk - set a small mirrored lv for root swap - then add the device swap separately so you get kind of twice as much - of course if you lose a root disk you go down to half swap - but hey..

here is a display
dev 2048 0 2048 0% 0 - 1 /dev/vg00/lvol2
dev 2000 0 2000 0% 0 - 1 /dev/vg00/lvswap1
dev 2000 0 2000 0% 0 - 1 /dev/vg00/lvswap2
reserve - 2066 -2066
memory 3081 839 2242 27%
total 9129 2905 6224 32% - 0 -

You can see we have lvswap1 and lvswap2 - they are the same size but on different physical disks of the root volume. lvol2 is mirrored normally - so I have 6GB of dev swap and 4GB if one of the disk fails - by leaving them at priorty 1 I get some rudimentary striping.
Just a way to get an extra little bit of swap without hurting anything or buying anything