472,958 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Meaning of direct_writes in tablespace snapshot

Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot
on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode)
* No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc
Nov 12 '05 #1
13 3300
"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot
on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode) * No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc

Is this a massive insert job? For starters, if you have multiple CPU's,
increase number of pages cleaners and I/O servers. How large is your buffer
pool?
Nov 12 '05 #2
"Mark A" <no****@nowhere.com> a écrit dans le message de
news:Qk*****************@news.uswest.net...
"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode)
* No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc

Is this a massive insert job? For starters, if you have multiple CPU's,
increase number of pages cleaners and I/O servers. How large is your

buffer pool?


Yes, this is a massive insert job, about 100 million rows. We have about 8
page cleaners and I/O servers per partition (SMS has 4 containers per
partition), and a ps -ef |grep -e db2clnr -e db2pfchr shows that some
processes have not consumed CPU. Buffer pool is about 20000 16K pages and
chgnpgs_threshold is set to 20%.

Do you mean that shortage of resources could lead DB2 to use direct writes ?

Regards,

JM
Nov 12 '05 #3
> > Is this a massive insert job? For starters, if you have multiple CPU's,
increase number of pages cleaners and I/O servers. How large is your buffer
pool?


Yes, this is a massive insert job, about 100 million rows. We have about 8
page cleaners and I/O servers per partition (SMS has 4 containers per
partition), and a ps -ef |grep -e db2clnr -e db2pfchr shows that some
processes have not consumed CPU. Buffer pool is about 20000 16K pages and
chgnpgs_threshold is set to 20%.

Do you mean that shortage of resources could lead DB2 to use direct writes

?
Regards,

JM

Take a look at this article about insert performance:
http://www-106.ibm.com/developerwork...m-0403wilkins/
Nov 12 '05 #4
Insert into a NLI table supposed to bypass the logging phase, of course it
would be the direct write.

"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot
on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode) * No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc

Nov 12 '05 #5
"Mark A" <no****@nowhere.com> a écrit dans le message de
news:CD*****************@news.uswest.net...
Is this a massive insert job? For starters, if you have multiple CPU's, increase number of pages cleaners and I/O servers. How large is your buffer
pool?


Yes, this is a massive insert job, about 100 million rows. We have about 8 page cleaners and I/O servers per partition (SMS has 4 containers per
partition), and a ps -ef |grep -e db2clnr -e db2pfchr shows that some
processes have not consumed CPU. Buffer pool is about 20000 16K pages and chgnpgs_threshold is set to 20%.

Do you mean that shortage of resources could lead DB2 to use direct

writes ?

Regards,

JM

Take a look at this article about insert performance:
http://www-106.ibm.com/developerwork...m-0403wilkins/


I have already read this very interesting article, and we pretty fit its
recommandations ...

To come back to my original question, why do I see "direct writes" and what
is the meaning ? I was thinking of SMS extent allocation, but it seems
changing the extent size (a SMS tablespace with extentsize 16 to a SMS
tablespace with extensize 32) does not multiply by 2 the "direct writes" /
"direct writes requests" ratio.

The DB2 documentation is incomplete on this matter.

Thanks,

JM
Nov 12 '05 #6
Hi Fan,

I don't agree with that (maybe I'm wrong). NLI table bypasses the logging
phase, but still uses bufferpools. So in that respect, all mechanisms with
bufferpools should apply, especially asynchronous page cleaning.

Anyway, if it were the case (maybe I'm still wrong), the "direct writes"
data element is not specifiying this NLI in its list. I'm still interested
to know the truth :-)

Best regards,

Jean-Marc

"Fan Ruo Xin" <fa*****@sbcglobal.net> a écrit dans le message de
news:dL***************@newssvr32.news.prodigy.com. ..
Insert into a NLI table supposed to bypass the logging phase, of course it
would be the direct write.

"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially

mode)
* No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc


Nov 12 '05 #7
"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot
on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode) * No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc

I am not sure what "direct_writes" means, but I found this information,
which may, or may not, be relevant:

"Direct I/O (DIO) is an alternative caching policy that reduces CPU
utilization for reads and writes by eliminating the copy from file cache to
user buffer. A read/write against a file opened with the O_DIRECT flag
causes data to be transferred directly between the user buffer and the disk.

When using the file system caching policy, which is the default policy for
DB2 UDB, all I/O operations are performed in buffered mode. While this
caching policy is extremely effective when the cache hit ratio is high, it
has an overhead of making an extra copy of the buffer from the disk to file
cache (in the case of read) or from file cache to disk (in the case of
write). Since the buffer is already cached in the DB2 buffer pool layer,
this dual level of caching proves to be unnecessary in situations where the
file system cache hit ratio is low and many I/O operations are performed."

So it appears that DIO bypasses the operating system file cache, since it is
usually redundant to the use of bufferpools to cache data. Again, I am not
sure if this is the same thing as direct_writes in the snapshot information.
Nov 12 '05 #8

"Mark A" <no****@nowhere.com> a écrit dans le message de
news:l0****************@news.uswest.net...
"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode)
* No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?

Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc

I am not sure what "direct_writes" means, but I found this information,
which may, or may not, be relevant:

"Direct I/O (DIO) is an alternative caching policy that reduces CPU
utilization for reads and writes by eliminating the copy from file cache

to user buffer. A read/write against a file opened with the O_DIRECT flag
causes data to be transferred directly between the user buffer and the disk.
When using the file system caching policy, which is the default policy for
DB2 UDB, all I/O operations are performed in buffered mode. While this
caching policy is extremely effective when the cache hit ratio is high, it
has an overhead of making an extra copy of the buffer from the disk to file cache (in the case of read) or from file cache to disk (in the case of
write). Since the buffer is already cached in the DB2 buffer pool layer,
this dual level of caching proves to be unnecessary in situations where the file system cache hit ratio is low and many I/O operations are performed."

So it appears that DIO bypasses the operating system file cache, since it is usually redundant to the use of bufferpools to cache data. Again, I am not
sure if this is the same thing as direct_writes in the snapshot information.


Hi Mark, the problem is DIO is supported from V8 on AIX, and I am on V7 :-((

When DB2 is using temp tables, the disks are fully utilized (Tempspace 16K
SMS, 4 containers) and no direct writes. When my SMS tablespace is used,
direct writes are used, and ratio keeps being 256*512, that is 128K.

Something related to db2empfa ? How can I raise this ratio to obtain 256K or
512K (the disks are about 25% usage ...) ?

Regards,

JM
Nov 12 '05 #9
Jean-Marc Blaise <no****@nowhere.com> wrote:
Hi there, I would like to know the meaning of direct_writes in a tablespace snapshot
on a tablespace that is: * SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode)
* No BLOB, long varchar ...in the table
* No utility running Can someone help understand why we see a high number of direct_writes ?


MPFA uses direct writes to append new pages to the object.

jsoh

Nov 12 '05 #10
"Josh Tiefenbach" <jt******@nowhere.in.ibm.com> a écrit dans le message de
news:cc**********@hanover.torolab.ibm.com...
Jean-Marc Blaise <no****@nowhere.com> wrote:
Hi there,

I would like to know the meaning of direct_writes in a tablespace snapshot on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially mode) * No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?


MPFA uses direct writes to append new pages to the object.

jsoh


Thanks Josh for this confirmation.

Is there any system or DB2 parameter that can be set to do direct writes
other than 128K (I mean 256K, 512K) or is this a fix rate ?

Best regards,

Jean-Marc
Nov 12 '05 #11
You are right. I was thinking of flush dirty pages to disk synchrously.
Anyway the most possible reason is you disable the MMAP_READ/WRITE. And when
you insert into an NLI table, db2 will try to write the dirty pages
synchronously. In this case you will see the DIRECT WRITES keep increasing
if you captured the snapshot a couple of times in sequential.

"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader5.wanadoo.fr...
Hi Fan,

I don't agree with that (maybe I'm wrong). NLI table bypasses the logging
phase, but still uses bufferpools. So in that respect, all mechanisms with
bufferpools should apply, especially asynchronous page cleaning.

Anyway, if it were the case (maybe I'm still wrong), the "direct writes"
data element is not specifiying this NLI in its list. I'm still interested
to know the truth :-)

Best regards,

Jean-Marc

"Fan Ruo Xin" <fa*****@sbcglobal.net> a écrit dans le message de
news:dL***************@newssvr32.news.prodigy.com. ..
Insert into a NLI table supposed to bypass the logging phase, of course it
would be the direct write.

"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:cc**********@news-reader2.wanadoo.fr...
Hi there,

I would like to know the meaning of direct_writes in a tablespace

snapshot on a tablespace that is:

* SMS (db2empfa ON)
* Only 1 table is accessed in INSERT - Z locked (Not logged Initially

mode)
* No BLOB, long varchar ...in the table
* No utility running

Can someone help understand why we see a high number of direct_writes ?
Version: DB2 UDB V7 EEE FP11 / Aix 5.1 ML4

Thanks for your help,

Jean-Marc



Nov 12 '05 #12
Jean-Marc Blaise <no****@nowhere.com> wrote:
Is there any system or DB2 parameter that can be set to do direct writes
other than 128K (I mean 256K, 512K) or is this a fix rate ?


No. Its capped at 128k - it may be less if extent size * page size is less
than 128k, but no higher.

jsoh

Nov 12 '05 #13
Thanks for this clear answer.

Regards,

JM

"Josh Tiefenbach" <jt******@nowhere.in.ibm.com> a écrit dans le message de
news:cc**********@hanover.torolab.ibm.com...
Jean-Marc Blaise <no****@nowhere.com> wrote:
Is there any system or DB2 parameter that can be set to do direct writes
other than 128K (I mean 256K, 512K) or is this a fix rate ?


No. Its capped at 128k - it may be less if extent size * page size is less
than 128k, but no higher.

jsoh

Nov 12 '05 #14

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

Similar topics

0
by: sandeep G | last post by:
I've a table which has a number & a blob column, both of which are NOT NULL type. This table is composite partitioned using range & hash on the same column. Each partition is sub partitioned into...
1
by: Eugene | last post by:
Is there a way to capture I/O statistics per tablespace container? Or, as long as DB2 normaly stripes/rebalances data pages across containers, the number of physical reads and/or writes from a...
6
by: robert | last post by:
just got out of a "class" on EXPLAIN, from a 390/v6 maven. was told that ACCESSTYPE = 'R' in the plan_table meant a TableSpace scan. hmmmm. next step up (or down, depending on your outlook)...
4
by: mairhtin o'feannag | last post by:
Hello, I want to ask the question "how large is each of the indexes in a particular tablespace??" since I want to know which user-created indexes are taking up huge amounts of space. I used the...
4
by: UDBDBA | last post by:
All: I see that that DMS tablespaces using raw devices have "File System cache" enabled by *default*. My understanding is that file system cache is applicable only for SMS. Here is the...
1
by: Michel Esber | last post by:
Hello, DB2 V8 FP 10 running Linux RedHat 4.0. I have created a system temporary tablespace and now I want to delete it. However: $ db2 "drop tablespace reorg" DB21034E The command was...
3
by: mike | last post by:
On DB2 EEE v8.2 on Linux/Windows/Unix, is there any catalog view that I can query with SQL to find tablespace-state? The state is not visible via SYSCAT.TABLESPACES. The state is visible by...
4
by: Joachim Klassen | last post by:
DB2 V8.2 FP10 on Windows I tested the following HADR scenario: - a new tablespace on a new filesytem is created on the primary System - the replay on standby fails because of lacking permissions...
0
by: Prash | last post by:
Hi Need help here. The following is the script to create one of our snapshots. CREATE SNAPSHOT PREEM_VIEW_SNP PCTFREE 0 PCTUSED 99 INITRANS 2 MAXTRANS 255 STORAGE (
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.