473,396 Members | 1,997 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,396 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 3319
"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 (
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.