473,385 Members | 1,192 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,385 software developers and data experts.

Direct reads & In memory Database

Dear all,

Our database (DB2 Workgroup 7.2 FP12) is constantly under heavy load.
Most time CPU usage (1 Pentium3 1Ghz) is more 50% busy.
We have 3GB RAM memory
Our normal workload is 200-300 dyn.sql/s.

The action question is there way to eliminate direct I/O?
By definition direct I/O is I/O that bypass bufferpools and used for
LONG VARCHAR and LOBs data.
But there a lot of LONG VARCHARs in system catalog tables.
size of system catalog is 64 mb so i want to place it all in RAM
memory

Is this possible?

Thanks in advance,
Oleg
Nov 12 '05 #1
10 4618
Ian
Alex Greem wrote:
Dear all,

Our database (DB2 Workgroup 7.2 FP12) is constantly under heavy load.
Most time CPU usage (1 Pentium3 1Ghz) is more 50% busy.
We have 3GB RAM memory
Our normal workload is 200-300 dyn.sql/s.

The action question is there way to eliminate direct I/O?
By definition direct I/O is I/O that bypass bufferpools and used for
LONG VARCHAR and LOBs data.
But there a lot of LONG VARCHARs in system catalog tables.
size of system catalog is 64 mb so i want to place it all in RAM
memory

Is this possible?

Thanks in advance,
Oleg


What's the catalog cache hit ratio? Are your direct reads all taking
place on SYSCATSPACE, or are they occurring in other tablespaces, too?

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #2
Ian <ia*****@mobileaudio.com> wrote in message news:<40********@corp.newsgroups.com>...
What's the catalog cache hit ratio? Are your direct reads all taking
place on SYSCATSPACE, or are they occurring in other tablespaces, too?


SYSCATSPACE have 99.99 bufferpool hit ratio.
Most of direct reads happens in SYSCATSPACE.
approximately 1000000(syscatspace) vs 10000 (other tablespaces)
I suspect this because of dinamyc sqls, we have many SQL functions
(their bodys stored in LONG VARCHAR column in catalog), views, etc...

So my intention is eliminate direct i/o as much is possible.
Nov 12 '05 #3
If one looks at how LONGVACHAR is handled in DB2, it will always be
handled by direct I/O and thus will NEVER go to a buffer pool. So,
loading all syscatcpace tables in a private syscat.spce buffer pool
wouldn't be the right approach.
There's no sense to load LONGVARCHAR in bp's as they would flood the bp
and impact all other apps.
They are therefore retrieved one by one, on demand, to the appl. private
memory of the agent requesting them. Thepointer is read from the row in
the page in thwe bp but the data is directly retrieved, using the
pointer, by reading the file and the long data is put in appl. private
memoty.

HTH, Pierre.

Alex Greem wrote:
Ian <ia*****@mobileaudio.com> wrote in message news:<40********@corp.newsgroups.com>...
What's the catalog cache hit ratio? Are your direct reads all taking
place on SYSCATSPACE, or are they occurring in other tablespaces, too?

SYSCATSPACE have 99.99 bufferpool hit ratio.
Most of direct reads happens in SYSCATSPACE.
approximately 1000000(syscatspace) vs 10000 (other tablespaces)
I suspect this because of dinamyc sqls, we have many SQL functions
(their bodys stored in LONG VARCHAR column in catalog), views, etc...

So my intention is eliminate direct i/o as much is possible.


--
Pierre Saint-Jacques - Reply to: sesconsjunk at attglobaljunk dot com
Reconstruct address: Remove the two junk and replace at and dot by
their symbols.
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.

Nov 12 '05 #4
Ian
Pierre Saint-Jacques wrote:
If one looks at how LONGVACHAR is handled in DB2, it will always be
handled by direct I/O and thus will NEVER go to a buffer pool. So,
loading all syscatcpace tables in a private syscat.spce buffer pool
wouldn't be the right approach.
There's no sense to load LONGVARCHAR in bp's as they would flood the bp
and impact all other apps.
They are therefore retrieved one by one, on demand, to the appl. private
memory of the agent requesting them. Thepointer is read from the row in
the page in thwe bp but the data is directly retrieved, using the
pointer, by reading the file and the long data is put in appl. private
memoty.


Isn't this mitigated by the catalog cache? I asked the OP about his
catalog cache, not the bufferpool hit ratio for the catalog.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #5
To my knowledge, the catalog cache is used to store table and object
descriptors (from the catalog tables) that are required to resolve,
compile SQL statements.
When a stmt is to be compiled, DB2 does a loookup in the catalog cache
for the descriptors of the objects required for the work and will insert
the ones it does not find.
From your previous post where you mention function bodies being held in
longvarchar, it is possible that the function is folded as a descriptore
on the catalog cache (but I don't really know this) but it would still
be a direct read as the only buffered read that I know of are the reads
that are done in the bp (for syscatspace) in this instance.
From your previous post, you mention a syscatcpace of 64MB and wonder
if you could het it all in memory. Yes you could could by building a
64MB buffer pool and assigning syscatcpace to it.
However, this still does not solve your problem of eliminating the
direct i/o reads. They are longvarchar and they still won't get stored
in the row and will have to read from the file in which they are stored.

Instead of giving that memory to a bp for syscatcpace, try to see what
happens if you assign the same space to catalog cache.
You are in V7 so be careful as the catalog cache is assigned pages from
the dbheap and you will have to increase it by 64MB before you update
the catalog cahe to 64MB.
HTH, Pierre.
Ian wrote:
Pierre Saint-Jacques wrote:
If one looks at how LONGVACHAR is handled in DB2, it will always be
handled by direct I/O and thus will NEVER go to a buffer pool. So,
loading all syscatcpace tables in a private syscat.spce buffer pool
wouldn't be the right approach.
There's no sense to load LONGVARCHAR in bp's as they would flood the
bp and impact all other apps.
They are therefore retrieved one by one, on demand, to the appl.
private memory of the agent requesting them. Thepointer is read from
the row in the page in thwe bp but the data is directly retrieved,
using the pointer, by reading the file and the long data is put in
appl. private memoty.

Isn't this mitigated by the catalog cache? I asked the OP about his
catalog cache, not the bufferpool hit ratio for the catalog.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


--
Pierre Saint-Jacques - Reply to: sesconsjunk at attglobaljunk dot com
Reconstruct address: Remove the two junk and replace at and dot by
their symbols.
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.

Nov 12 '05 #6
ol************@yahoo.com (Alex Greem) wrote in message news:<ac**************************@posting.google. com>...
Dear all,

Our database (DB2 Workgroup 7.2 FP12) is constantly under heavy load.
Most time CPU usage (1 Pentium3 1Ghz) is more 50% busy.
We have 3GB RAM memory
Our normal workload is 200-300 dyn.sql/s.

The action question is there way to eliminate direct I/O?
By definition direct I/O is I/O that bypass bufferpools and used for
LONG VARCHAR and LOBs data.
But there a lot of LONG VARCHARs in system catalog tables.
size of system catalog is 64 mb so i want to place it all in RAM
memory

Is this possible?

Thanks in advance,
Oleg


the trick is to use the o/s buffers, and pin same.

IIRC, on *nix anyway, one can memmap the file, then pin the o/s
cache. i've no recollection of the syntax. on windoze, no recollection.
Nov 12 '05 #7
> the trick is to use the o/s buffers, and pin same.

IIRC, on *nix anyway, one can memmap the file, then pin the o/s
cache. i've no recollection of the syntax. on windoze, no recollection.


Yes, OS cache should help here - but i'm on windows and i just don't
know if it possible explicitly manage windows file cache's - may
somebody knows it?

So i see there no easy way to eliminate direct i/o on syscatspace...
That mean views,triggers,sql functions bodies always retrieved from
disk (or OS cache, if possible).
That's can quite limiting issue is high dynamic sql scenario, isn't
that so?
Nov 12 '05 #8
ol************@yahoo.com (Alex Greem) wrote in message news:<ac**************************@posting.google. com>...
the trick is to use the o/s buffers, and pin same.

IIRC, on *nix anyway, one can memmap the file, then pin the o/s
cache. i've no recollection of the syntax. on windoze, no recollection.


Yes, OS cache should help here - but i'm on windows and i just don't
know if it possible explicitly manage windows file cache's - may
somebody knows it?

So i see there no easy way to eliminate direct i/o on syscatspace...
That mean views,triggers,sql functions bodies always retrieved from
disk (or OS cache, if possible).
That's can quite limiting issue is high dynamic sql scenario, isn't
that so?


http://www.peg.com/lists/dba/history.../msg00325.html

this describes how progress did/does it. but i gather that this is an
application switch, i.e. they implement it themselves.
there is also this from an aix site:

v_pinshm Purpose:
If set to 1, will allow pinning of shared memory segments.
Values:
Default: 0 (off)
Range: 0 or 1.
Type: Dynamic
Diagnosis:
Change when there is too much overhead in pinning or unpinning of AIO
buffers from shared memory segments.
Tuning
Useful only if application also sets SHM_PIN flag when doing a shmget
call and if doing async I/O from shared memory segments.
Refer To:
Miscellaneous I/O Tuning Parameters

so, it is implemented; but perhaps not at user level. wouldn't be the
first time.
Nov 12 '05 #9
Ian
Alex Greem wrote:
the trick is to use the o/s buffers, and pin same.

IIRC, on *nix anyway, one can memmap the file, then pin the o/s
cache. i've no recollection of the syntax. on windoze, no recollection.

Yes, OS cache should help here - but i'm on windows and i just don't
know if it possible explicitly manage windows file cache's - may
somebody knows it?

So i see there no easy way to eliminate direct i/o on syscatspace...
That mean views,triggers,sql functions bodies always retrieved from
disk (or OS cache, if possible).


Access plans for dynamic SQL statements are cached, too, which should
help eliminate the need for constant access.
That's can quite limiting issue is high dynamic sql scenario, isn't
that so?


Are you actually having a problem, or is this just a perceived problem?
What is your average service time for each direct read?


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #10
Ian <ia*****@mobileaudio.com> wrote in message news:<40fee7e4>
Access plans for dynamic SQL statements are cached, too, which should
help eliminate the need for constant access.

You mean pckcachesz memory?
we have 40000*4kb = 160Mb, but sometimes during the working day
"package cache hit rate" is dropped under 50%.
Unfortunally i can't control our programmers to force them to use
parameterized query instead of hard-coded values in sql. This makes
pckcachesz memory inefficient.
That's can quite limiting issue is high dynamic sql scenario, isn't
that so?


Are you actually having a problem, or is this just a perceived problem?
What is your average service time for each direct read?

Well i just trying to make things faster... and direct i/o is just one
thing among others to optimize.
How can i measure average service time for direct i/o request?
I have these figures now (for SYSCATSPACE):
direct read requests 1186045
direct reads 2725124
Direct reads elapsed time (ms) 3183837
Nov 12 '05 #11

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

Similar topics

5
by: Bruce Pullen | last post by:
DB2 7.2 (ESE) on AIX 5.2. In 3 weeks, we've seen the following : Tablespace name = SYSCATSPACE Direct writes = 150306 Direct write elapsed...
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
5
by: Nadav | last post by:
Hi, I am trying to get a direct pointer to the address of the screen ( something like 0x0b00 in the happy DOS days ), how can I do that? Should this be done in the kernel or it can also be done...
3
by: Kevin Bartz | last post by:
I'm de-duping a 45-million-row table (about 4 gigs) by creating a new table with the unique rows of the first table (should be about 3 gigs). I'm on a 64-bit SuSE Linux with 2 gigs of memory and...
4
by: serge | last post by:
I am running a query in SQL 2000 SP4, Windows 2000 Server that is not being shared with any other users or any sql connections users. The db involves a lot of tables, JOINs, LEFT JOINs, UNIONS...
21
by: Mark Cooney | last post by:
Good afternoon, yes i am a newby so pls keep it simple. Yesterday I started a small project where I have to make an API call and receive back from that the long xml transcript down below. Now,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.