1855760 Members
9036 Online
104103 Solutions
New Discussion

Re: swap

 
Shrikant_4
Advisor

swap

I have HP rp7400 server. I have two swap devices of 2GB and 4 GB. OS is HP-UX-11 and RAM is 4GB. I have turned on psedo-device of 3GB. There are 4-5 databases running on server. I heard that when RAM get full, swapping start to swap-device and then to psedo-device.
But on this server i found that swapping start to both psedo-device and swap-device. When psedo-device get full, server gets hang. But still there is space in swap-device. Why server is not utilising space in the swap-device ? please ses the attachment(o/p of swapinfo )
18 REPLIES 18
T G Manikandan
Honored Contributor

Re: swap

With priority with both the swap ,system is using the the swap at the same time.

# swapinfo -tm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 610 3486 15% 0 - 1 /dev/vg00/lvol2
dev 2048 603 1445 29% 0 - 1 /dev/vg00/lvol10
reserve - 4931 -4931
memory 3068 2929 139 95%
total 9212 9073 139 98% - 0 -



Avaiable is 4096 + 2048 = 6GB.

Used is 610 + 603 + 4931(reserve area) =6GB

Before executing a process in RAM the same amount of swap is reserved for the process.This is because if the process is to be swapped it can use this space.

you should add the reserve area during the calculation and which equates fine.

Hoang Minh Tuan
Regular Advisor

Re: swap

Hi,

Psuedo-swap is a virtual swap, It not like swap becuase swap device will dedicated total space for instruction buffer input/output whereas psuedo-swap will use remain disk space so it will change time to time and O.S will caculate how many space size on HDD reserve for swap. It depend on how your applications, processes run.

Your total REAL swap is 6GB (greater than 4GB of RAM) so that you should not turn up Psuedo-swap. Besides, your REAL swap use approximately 20%, it not high.
Turn off Psuedo-swap by setting Swapmemon value zero (0).
I think it will solve your problem.

HMT
Bus wait at bus station, Work wait at my work station
Shrikant_4
Advisor

Re: swap

hi,
I dodn't understand what is reserve area. what i want is why it is not utilising swap-device. swap-device is showing only 20% used.
If i set the swapmemon parameter to 0. is system reboot requried to take place effect?
if somebody surely know that after this change it will use swap-device fully, i am going to do that.
so guide me,
Shrikant
Trond Haugen
Honored Contributor

Re: swap

USING the swap isn't the aim. Rather the oposite.
When a program starts it will RESERVE swap. When the demand for memory is larger than RAM, paging will occure. If the memory preasure increases process deactivation will occure.

In you swapinfo output free is smaller than used my pseudo swap. If you turn speudowasp off I would say you will not be able to start all your databases.

If you are going for performance. And you should. I would reccomedn more memory on the system. The aim is 0% USED. So I would say you need another 2Gb of RAM.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
T G Manikandan
Honored Contributor

Re: swap

A process uses the swap after reserving it.

So first it reserves space in swap and then it uses it.

Now,from your output you have 80% of swap reserved by processes and 20% used by them.

So your swap is full.
T G Manikandan
Honored Contributor

Re: swap

If you want to know more about memory management check

/usr/share/doc/mem_mgt.txt
Steven E. Protter
Exalted Contributor

Re: swap

The day that comes when you are paging in and out of swap on a regular basis is the day you ask management to pay for more memory.

Actual day to day use of swap is something we try as sysadmins to avoid.

If you are paging you have two choices:
1) Reduce the use of memory(LOL)
2) Get more memory.

You can reduce memory use by making adjustments to dbc_max_pct (make sure its low and only a few points above dbc_min_pct) and by tuning your oracle or database memory configuration.

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
Steve Steel
Honored Contributor

Re: swap

Hi


My favourite explain is on

ftp://eh:spear9@hprc.external.hp.com/memory.htm

Introduction
The memory line in the output of swapinfo
swapinfo fully explained

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Shrikant_4
Advisor

Re: swap

hi all
This server has 4-5 databases plus application server and many other applications. it reuire swap-space. i can not avoid that due to huge memory requirement.
My question is very straight forward, why server is not using swap-device fully ?
if i add one more swap-device(2 GB) , what is the use of that if server is not going to utilise fully? why it is not utilising existing swap-device fully.
Is it like that server reserves memory in swap-device but not showing in o/p of used column of 'swapinfo -tm' command.
thanks,
shrikant

Trond Haugen
Honored Contributor

Re: swap

If your aim is to fully utilize swap then you aim is bad performance and a memory/swap bottleneck.
The answers are also very stright forward. But they assume you would like to avoid performance problmes.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Shrikant_4
Advisor

Re: swap

hi
My aim is not utilise swap-device fully. But when server HANG showing 100% memory in total used column of 'swapinfo -tm' command, at that time swap-device shows 20%. if I increase the swap device, will it help me to avoid server hang problem ? if i increse swap-device by 2 gb, server config will become 4GB RAM, 8 GB swap-device, 3GB psedo-swap. Is it OK?
thanks
shrikant
Hoang Minh Tuan
Regular Advisor

Re: swap

Shrikant,

You have to know that your server will not use completely swap-space before it go to psuedo.
HP-UX will adjust between two spaces to avoid performance bottleneck (disk I/O bottleneck).
Please show your result of sar -w 2 100 (swap page in/out), sar -b 1 10(buffer cache) and sar -d (disk activity).

If your disks is full of action with ouput of sar -d , I recommend you do not increase swap space. The best way is increase RAM up to 6GB.

HMT
Bus wait at bus station, Work wait at my work station
Trond Haugen
Honored Contributor

Re: swap

Get your point. Your problem is that the system hangs. And when it does swapinfo shows 100% on pseudo swap.
Your hang may not be swap related. But adding more swap is a cheap and quick way of finding out. (If after adding the swap you system don't hange, you are done. Pseudoswap at 100% is not a problem in it self.)

On the other hand if you are able to check you swap usage the system isn't realy hung.
Also it could be some other reason your system is slow. It could be heavily paging or even deactivating processes. Use vmstat and look for a high 'page po' rate.
There are of course several other posible reasons for a hang (CPU, IO, network).

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Shrikant_4
Advisor

Re: swap

hi Haugen and Honag
I am sending o/p of command sar. I think this time i will get right solution from you.
Thanks a lot,
Shrikant.
Shrikant_4
Advisor

Re: swap

hi Haugen and Honag
I am sending o/p of command sar. I think this time i will get right solution from you.
Thanks a lot,
Shrikant.
Trond Haugen
Honored Contributor

Re: swap

The sar -w shows no swapouts. This indicates no memory bottleneck.
sar -b shows a very low hit on read cache. Could be just fine given you have severad bd's running.
sar -d %busy< and avwait < avserv. No disk bottleneck.

Seems to me the OS is doing fine. Whas these commands run when there was problems with the system?
When the system is hanging, is that reported by the database users or do HP-UX commands hang too? In case of the latter which commands hang?
When the sysem is reported to hang what are the load average and CPU usage (top, uptime, sar -u)?

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Shrikant_4
Advisor

Re: swap

hi,
When server was hang, i could run Hp commands easily, but database connections were not getting. please find the attachment.
Thanks,
Shrikant
Trond Haugen
Honored Contributor

Re: swap

Makes sense. There are no OS bottlenecks. The hang is only in the databse and the DBA should look into it.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn