Operating System - Linux
1830096 Members
6124 Online
109998 Solutions
New Discussion

Re: Utilizing the RAM space than swap

 
Pratheesh
Advisor

Utilizing the RAM space than swap


We have an application written in C++ and is running on Linux Read Hat RHEL 3.6 and is using oracle 9i database. As this is a volume application had some performance issue with the database, we wanted to increase the db cache parameters like( db_cache_size and db_keep_cache_size) to get a better DB performance. We had to increase these parameters by 1.5Gb abd 0.5Gb respectively.

The free command before applying this oracle db parameters is:
------------------------------------------
[hpfms@fms ~]$ free
Total used free shared buffers cached
Mem: 16051288 14884600 1166688 0 1229580 3602672
-/+ buffers/cache: 10052348 5998940
Swap: 16386292 95612 16290680

------------------------------------------



And after the change, it became:

[hpfms@fms stats]$ free
Total used free shared buffers cached
Mem: 16051288 16036044 15244 0 67432 5393104
-/+ buffers/cache: 10575508 5475780
Swap: 16386292 3422920 12963372

------------------------------------------

As per the Linux memory management, we expected the extra DB buffers to get the RAM from the OS cached and buffered part of memory( from free command.

But, ultimately it resulted in utilizing the available swap space and have a more severe performance problem including the bad disk response.

How do we reduce the OS cached memory and use it for process purpose there by reducing the swap usage?

It will be great if you can respond urgently on this.

Thanks in advance.

Pratheesh/Shelendra,

Note for better readability we are attaching the word document



3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Utilizing the RAM space than swap

Shalom,

You do nothing.

Memory allocation is not working the way you assumed it was.

When your program is loaded, you see swap being "used" It is being allocated, "In case" the program, the entire program needs to be swapped to disk.

The amount of memory being taken from cache is based on a standard formula designed to leave overall memory allocation around a fixed percentage in the 90% range.

It is possible, though a big pain to reduce the cached memory use. That will do nothing to the amount of swap allocated because it allocated to insure there is a place to put this program when the system actually has to page the program.

As long as the system is not paging there will be no impact on performance.

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
Pratheesh
Advisor

Re: Utilizing the RAM space than swap

Hi SEP,
Thanks for the reply.
Our problem is also sudden increase in SWAP/Page utilization after our DB Cache parameter changes. as you Can see from the free command output previous SWAP utilization was ~95 MB which after chnages reached to ~3.4 GB. And also degraded the performance further by about ~50%.
Steven E. Protter
Exalted Contributor

Re: Utilizing the RAM space than swap

Shalom,

Can you take some vmstat data for me?

The system will reduce buffers without any help from us systems administrators.

I would try reducing the footprint of the application or increasing system ram.

Forcing a reduction in buffer use will do no good.

sysctl -a

I'd like to see if the buffer cache has been fixed in some way. That would be bad.

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