From: Mark A on
For DB2 Version 9.5, does setting swappiness= 0 (/proc/sys/vm/swappiness) on
RHEL 5 sufficiently limit Linux file system caching, or is there some other
way to limit on the percent of memory that can be used for Linux file system
caching.

Please do not explain to me how DB2 tablespace file system caching (or no
file system caching) works. I already know about that and I am talking about
Linux OS configurations for a DB2 data server where almost all tablespaces
are defined with no file system caching (except those that contain LOB's).


From: Troels Arvin on
Mark A wrote:

> For DB2 Version 9.5, does setting swappiness= 0
> (/proc/sys/vm/swappiness) on RHEL 5 sufficiently limit Linux file system
> caching, or is there some other way to limit on the percent of memory
> that can be used for Linux file system caching.

My completely non-authoritative answer would be:

The vm.swappiness parameter is irrelevant here.

To prevent file system caching, DB2 will use relevant file system API
hooks to instruct the kernel to skip caching of reads and writes. DB2
probably uses the O_DIRECT flag when opening the involved data files; or
perhaps IBM has listened to Linus Torvalds and uses other API facilities:
http://kerneltrap.org/node/7563

--
Troels
From: Ian on
On 2/23/10 12:06 PM, Troels Arvin wrote:
> Mark A wrote:
>
>> For DB2 Version 9.5, does setting swappiness= 0
>> (/proc/sys/vm/swappiness) on RHEL 5 sufficiently limit Linux file system
>> caching, or is there some other way to limit on the percent of memory
>> that can be used for Linux file system caching.
>
> My completely non-authoritative answer would be:
>
> The vm.swappiness parameter is irrelevant here.

I don't think that this is irrelevant. There are many other files on
the system accessed outside of DB2. A simple daily cron job calling
updatedb can wreak havoc, sucking memory into the file system cache.





From: Mark A on
"Troels Arvin" <troels(a)arvin.dk> wrote in message
news:hm190a$6js$2(a)news.net.uni-c.dk...
> My completely non-authoritative answer would be:
>
> The vm.swappiness parameter is irrelevant here.
>
> To prevent file system caching, DB2 will use relevant file system API
> hooks to instruct the kernel to skip caching of reads and writes. DB2
> probably uses the O_DIRECT flag when opening the involved data files; or
> perhaps IBM has listened to Linus Torvalds and uses other API facilities:
> http://kerneltrap.org/node/7563
>
> --
> Troels

I specifically mentioned in my OP that I was not asking how DB2 turns off
file system caching of DB2 tablespace containers, but I pretty much knew
that there would be someone who could not control themselves.

I believe there is a Linux parameter that can limit file caching memory to a
percent of total system memory, but I noticed that IBM only recommended the
following kernel parameters, and was wondering if these are enough to limit
file system caching (such as might occur during a DB2 backup to a file) to a
reasonable percent of the total memory.

vm.swappiness=0
vm.dirty_ratio=10
vm.dirty_background_ratio=5


From: Mark A on
"Ian" <ianbjor(a)mobileaudio.com> wrote in message
news:oiXgn.3025$mn6.949(a)newsfe07.iad...
> I don't think that this is irrelevant. There are many other files on
> the system accessed outside of DB2. A simple daily cron job calling
> updatedb can wreak havoc, sucking memory into the file system cache.

Exactly. I was specifically NOT referring to OS caching of DB2 tablespace
containers, but caching of other files by the OS. Some of these files may be
related to DB2 such as DB2 backup files.