473,418 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

db2 File system caching ..DIO or CIO??

Raj
What is the purpose of file system caching while creating a tablespace?
Memory on the test server gets used up pretty quickly after a user
executes a complex query(database is already activated), after some
investgation i found out that most of it being consumed by filesystem
caching... thanks to Liam and Phil Sherman for their valuable
suggestions. Is it safe to turn off filesystem caching on every
tablespaceon the server(i.e. DIO) ?? or can we set DB2_MMPAP_READ=ON
and DB2_MMAP_WRITE=ON ?? what is the down side of it?? We do have a big
enough bufferpool...

---------------------------------------------------------------------------------------------------------------------------------------
vmstat -v
2097152 memory pages
1982466 lruable pages
862 free pages
1 memory pools
130485 pinned pages
80.1 maxpin percentage
20.0 minperm percentage
80.0 maxperm percentage
37.7 numperm percentage
747627 file pages
0.0 compressed percentage
0 compressed pages
0.0 numclient percentage
80.0 maxclient percentage
0 client pages
0 remote pageouts scheduled
0 pending disk I/Os blocked with no pbuf
1199107 paging space I/Os blocked with no psbuf
1744312 filesystem I/Os blocked with no fsbuf
0 client filesystem I/Os blocked with no fsbuf
0 external pager filesystem I/Os blocked with no
fsbuf
---------------------------------------------------------------------------------------------------------------------------------------
Thanks,
Raj

Mar 31 '06 #1
5 7818
File systme caching has nothing to do with a database. It is an
operating system mechanism to improve I/O performance when working with
files. Operating systems attempt to improve I/O performance by caching
frequently used data (ie. a directory) in memory to avoid the physical
I/O delays when it's necessary to READ data. On a dedicated database
system, this acts in a similar fashion to a processor's level 1 and
level 2 caches where the buffer pool is level 1 and the file system
cache is level 2. (Note that the cache proportions here are much
different than hardware caches.)

Real memory larger than program needs, if not used, is a wasted
resource. Mature, well designed, operating systems such as AIX, UNIX,
LINUX and others use this "excess" memory to support a large file system
cache. When program memory requirements rise, then the cache is shrunk
as needed. As requirements fall, the cache is expanded keeping memory
"in use".

Vmstat only provides you with part of the information you need to
determine if your database system is taking advantage of the operating
system's file caching mechanism. You need database statistics showing
the percentage of requests being handled by the buffer pool and the I/O
performance when the data being read is not in the buffer pool. Don't
forget that UDB uses two I/O mechansims, one for individual rows,
another for scans. Descriptions of the statistics and the formulas to
compute I/O performance are available in the manuals.

Your vmstat output indicates 2g memory on the system with about 35% of
it currently being used for caching the file system. If this system is
only a database servier, then your "big enough" buffer pool could be
expanded quite a bit. A competent DBA, with a good knowledge of the
application requirements can probably find a better use for the memory
than the file system's caching mechanism can.

I'd get a good baseline of buffer pool performance under a number of
different workloads and start altering your tablespaces, one by one, to
not use file system caching. Carefully measure buffer pool performance
with each one you change to verify that you are maintaining your buffer
pool performance. Don't be surprised if you see little change in the
vmstat file pages because the operating system will fill them with other
file data. Also keep an eye on paging - it it starts rising, you'll need
to investigate its causes.

Philip Sherman


Raj wrote:
What is the purpose of file system caching while creating a tablespace?
Memory on the test server gets used up pretty quickly after a user
executes a complex query(database is already activated), after some
investgation i found out that most of it being consumed by filesystem
caching... thanks to Liam and Phil Sherman for their valuable
suggestions. Is it safe to turn off filesystem caching on every
tablespaceon the server(i.e. DIO) ?? or can we set DB2_MMPAP_READ=ON
and DB2_MMAP_WRITE=ON ?? what is the down side of it?? We do have a big
enough bufferpool...

---------------------------------------------------------------------------------------------------------------------------------------
vmstat -v
2097152 memory pages
1982466 lruable pages
862 free pages
1 memory pools
130485 pinned pages
80.1 maxpin percentage
20.0 minperm percentage
80.0 maxperm percentage
37.7 numperm percentage
747627 file pages
0.0 compressed percentage
0 compressed pages
0.0 numclient percentage
80.0 maxclient percentage
0 client pages
0 remote pageouts scheduled
0 pending disk I/Os blocked with no pbuf
1199107 paging space I/Os blocked with no psbuf
1744312 filesystem I/Os blocked with no fsbuf
0 client filesystem I/Os blocked with no fsbuf
0 external pager filesystem I/Os blocked with no
fsbuf
---------------------------------------------------------------------------------------------------------------------------------------
Thanks,
Raj

Mar 31 '06 #2
Raj
Thank you so much for your time and the detailed explanation ...The mem
allocation on our server is --> out of 8gb mem, 2.7 gb is allocated
to bufferpools and 4.2G is used by db2, when we run complex sql's the
free memory (from nmon/vmstat) reduces and paging happens (pi & po
vmstat )...

Mar 31 '06 #3
Ian

The only point I would add to Phil's comments: The file system cache
effectively creates double-buffering if you are using SMS or DMS file
containers. This degrades performance somewhat, and is why solutions
like concurrent IO or direct IO are helpful in database systems.

Also: On AIX (since that's what you show in vmstat -v output), you
can alter the behavior of the file system cache with the vmo command
and the minperm/maxperm parameters.
Apr 2 '06 #4
"Ian" <ia*****@mobileaudio.com> wrote in message
news:44********@newsfeed.slurp.net...

The only point I would add to Phil's comments: The file system cache
effectively creates double-buffering if you are using SMS or DMS file
containers. This degrades performance somewhat, and is why solutions
like concurrent IO or direct IO are helpful in database systems.

Also: On AIX (since that's what you show in vmstat -v output), you
can alter the behavior of the file system cache with the vmo command
and the minperm/maxperm parameters.


What about caching and pre-fetching built into some disk subsystems like
NAS?
Apr 2 '06 #5
Ian
Mark A wrote:
"Ian" <ia*****@mobileaudio.com> wrote in message
news:44********@newsfeed.slurp.net...
The only point I would add to Phil's comments: The file system cache
effectively creates double-buffering if you are using SMS or DMS file
containers. This degrades performance somewhat, and is why solutions
like concurrent IO or direct IO are helpful in database systems.

Also: On AIX (since that's what you show in vmstat -v output), you
can alter the behavior of the file system cache with the vmo command
and the minperm/maxperm parameters.


What about caching and pre-fetching built into some disk subsystems like
NAS?


What about them?

Caches at the disk subsystem level are a totally different beast from
the OS file system cache. Their effectiveness depends on a large number
of variables, such as workload (for the entire disk subsystem, not just
for the specific database), RAID and LUN design, and implementation at
both the OS and database levels.

Apr 2 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: ajikoe | last post by:
Hello, If I use os.remove(fileName), does it always assure that the code will move to the next code only if the fileName is deleted completely? Pujo
7
by: clusardi2k | last post by:
Hello, I have a shared drive on SGI, Linux, and Windows. A second call to fopen doesn't create the file if it has been deleted. I would like to use fopen for its pointer return value to...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: MarkWH | last post by:
I am writing a simple reverse proxy using .Net. The basic design is to capture all traffic (from all URL's) in an HttpHandler and the respond accordingly. The problem is that I when a URL is...
5
by: Joe | last post by:
I'm getting the following error when trying to call a page on a secure server. I'm not doing any impersonations or file access of any kind. The page is using PayPal and I'm wondering if PayPal has...
17
by: shineofleo | last post by:
Here is the situation: I wrote a VB programm, which stores all the information in a single Access database file using jet engine. It worked well, however one of my customs reported that there was...
5
by: Russell Warren | last post by:
I've got a case where I'm seeing text files that are either all null characters, or are trailed with nulls due to interrupted file access resulting from an electrical power interruption on the...
17
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.