If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 temporaray tablespace with file system caching

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-10, 11:59
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
DB2 temporaray tablespace with file system caching

Hi Guys,

We are migrating DB2 from v8.2 to v9.7(FP1) also we are moving from AIX 5.3 to AIX 6.1

We were glad initially with the DB2 v9.7 outputs, we were testing a lot and the output was good and we are all surprised. As and when days progressed, we observed LOAD utility and reorg on tables took longer time than the usual. While running LOAD utility, any other parallel jobs affected the server response and the server started to act slow.

We navigated the issue and found the server response were going down because of I/O issue. (LOAD & reog uses temporary tablespace which in turn uses high disk usage).

Since it was a testing server, i dropped the DB and planned to recreate it from scratch. Initial 5- 10 mins the server was still slow, after that 10 mins server was back to the stage it was one month back.

So logically dropping the DB, flushed something on the server and came back to normal. So we are not able to find out where the issue is, and am expecting the server to act slow after few weeks.

Are there any best practices for designing temporary tablespaces? Also we are suspecting the issue might be more on file system caching at file system level or SAN level. Are there any recommendations for file system caching on temporary tablespaces? and is it recommended to shut down file system caching on OS level for temporary tablespace file system?

All our eyes are now on file system caching for SMS, so any input on file system caching will be helpful.

Thanks,
Dharmaraj.G
Reply With Quote
  #2 (permalink)  
Old 10-03-10, 14:57
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Take a look at the following redbook:
http://www.redbooks.ibm.com/redbooks/pdfs/sg247821.pdf

In addition to caching recommendations, check VMM guidelines. You can also check the following technote:
IBM - Recommended AIX Virtual Memory Manager settings for DB2


I'd also recommend reviewing known issues for DB2 on AIX doc:
IBM - Known issues for DB2 on AIX 5.2, 5.3, and 6.1


Both load and (offline) reorg rebuild indexes and write to the history file. Large history file can slow down performance of utilities such as load/reorg so regular pruning is recommended. If you see high wait cpu / blocked queue in vmstat, this can indicate some kind of I/O issue, check busy disks in iostat. If you determined that the tempspace resides on those disks, then db2 is most likely spilling sorts. You can check the size of TDA files (sort temp files) in your tempspace. If sortheap is not large enough, db2 will spill to tempspace's bufferpool and then can go to tempspace on disk. It then has to read it back from disk again. This is all extra I/Os. If you see a lot of sort spills (load will allocate one sort per index), you may consider increasing sortheap / sheapthres_shr / sheapthres (if using private sorts) and increasing the bufferpool.

Please check the redbook for more info. To understand what's happening, you need to capture DB2/AIX info at regular intervals (when system is performing well and when it's slow) and then examine it.
Reply With Quote
  #3 (permalink)  
Old 10-03-10, 18:15
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
Thanks bella for your link and information.. we are using that redbook as reference in our lab to set AIX parameters.

LOAD utility usually performs two phase
1) Loading data
2) Rebuilding indexes

Interestingly, at the stage of rebuilding indexes there are not much temporary tablespace usage, at the 1st phase its creating a lot of TDA files, that too 10 files of almost 1GB files each, thats were am worried.

Any clue, why its creating lot of TDA files at loading phase?

Thanks,
Dharmaraj.G
Reply With Quote
  #4 (permalink)  
Old 10-03-10, 18:48
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Load inserts index keys into sort during the load phase. When the number of keys exceed sortheap, it's sorted and then spilled. During the build phase, they're read and merged together, possibly spilling again. So, it's not unusual to see large TDA files created during the load phase. Increasing sortheap /sheapthres(_shr) will help minimize it.
Reply With Quote
  #5 (permalink)  
Old 10-04-10, 11:04
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
Sure... will try to increase sorting parameters and give a try, my another concern is why its loading faster at early stages and loading time decreases gradually as the number of times the load operation are repeated.

Also why after dropping the DB and recreating from scratch making the load to run faster again? not only load, my whole server started responding faster as good as first day after DB recreation.
Reply With Quote
  #6 (permalink)  
Old 10-04-10, 11:23
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
in V9.7, STMM parameters are quite well managed by DB2 as we have experienced compared to the previous versions, you can try AUTO for SORT and SHEAP if possible. Regarding the LOAD timing, you could have also tried, Dropping the INIDICES, do the LOAD and then recreate the INDEX everytime, if you are doing it in a batch mode.
__________________

Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi
Reply With Quote
  #7 (permalink)  
Old 10-05-10, 20:34
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
What would you recommend for filesystem caching on SMS temporary tablespaces? OFF or ON?

Last edited by db2girl; 10-05-10 at 20:39.
Reply With Quote
  #8 (permalink)  
Old 10-05-10, 22:00
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
As per IBM redbook, SMS temp tablespace must have file system caching ON on database side. Also those file systems must have 'rbrw' mount options.

Our SMS temp tablespace had file system caching ON, but the mount option we are still working on.

Is there any way to flush the file system cache of one particular file system at AIX level?
Reply With Quote
  #9 (permalink)  
Old 10-05-10, 23:23
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by dharmaraj_ganesan View Post
As per IBM redbook, SMS temp tablespace must have file system caching ON on database side.
Can you provide a link and page number of the document where you saw this?
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #10 (permalink)  
Old 10-06-10, 00:11
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
here is the link,

http://www.redbooks.ibm.com/redbooks/pdfs/sg247821.pdf

page no. 101

Its making a indirect talk of mounting file system "rbrw" for temporary tablespace which usually has file system caching ON.

correct me, if i understood wrongly....

Thanks,
Dharmaraj.G
Reply With Quote
  #11 (permalink)  
Old 10-06-10, 08:13
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by dharmaraj_ganesan View Post
here is the link,

http://www.redbooks.ibm.com/redbooks/pdfs/sg247821.pdf

page no. 101

Its making a indirect talk of mounting file system "rbrw" for temporary tablespace which usually has file system caching ON.

correct me, if i understood wrongly....

Thanks,
Dharmaraj.G
I am assuming that is PDF page number 101, which is document page number 71 (bottom of page), but I think I found it.
"Mount option rbrw is recommended for specific file systems where FILE
SYSTEM CACHING is used to get better performance (such as temporary
table spaces, table spaces with LONG and LOB data, BACKUP file systems)."
I do see where they suggest that temporary tablespaces would have file system caching on, but it doesn't seem to me they are saying that "SMS temp tablespace must have file system caching ON."

1. Is there something different about SMS temp tablespaces than DMS temp tablespaces?
2. Why would temp spaces need file caching while it is clearly not recommended for data tablespaces?

It is clear why file system caching is recommended for tablespaces that primarily have LOB's, since they are not cached in bufferpools, but I don't understand why it is an issue for temp tablespaces (unless a lot of LOBs are ending up in temp tablespaces?).

I don't claim that I know the answer to these questions, but the Red Book you quoted does not seem to be definitive about using file system caching on temp tablespaces, or at least does not give an explanation as to why it recommends that.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #12 (permalink)  
Old 10-06-10, 10:37
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
Yes i do agree there are no precise documents for file system caching on temporary tablespace, since we are in the process of building new environment we wanted to design it well ahead. So trying out options.

We have a I/O disk issue on our existing environment because of certain flaws in the design, so we doesnt want those flaws again on new environment. But unfortunately we are ending into the same I/O disk issue on new environment too. Those I/O contentions are happening on temporary tablespace file system.

So only we need a best practice on temporary tablespace design. Still we are yet to try that mount option, hoping it will give us some good results.
Reply With Quote
  #13 (permalink)  
Old 10-06-10, 10:42
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
For bella, logically i would recommend file system caching ON for SMS temporary tablespace.
Reply With Quote
  #14 (permalink)  
Old 10-06-10, 11:11
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
Turn the FSC OFF for whether it is SMS or DMS. IBM strongly recommends to take advantage of BUFFERPOOL while managing the memory instead of allowing the Operating System to do it's job by turning Filesystem caching ON.

So whether it's SMS or DMS, let the FS Caching be OFF. You should tune all the available Registry Variables and DB/DBM CFG parameters alongwith Bufferpool to have lower I/O hit.
__________________

Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi
Reply With Quote
  #15 (permalink)  
Old 10-06-10, 11:44
dharmaraj_ganesan dharmaraj_ganesan is offline
Registered User
 
Join Date: Aug 2008
Posts: 23
I too agree, DB2 strongly recommending FSC off.

But logically to avoid double buffering we are turning that off on DB2 side. When it comes to temporary tablespace, its all about your TDA files on disk. So it needs some kind of caching for those files probably thats the reason why FSC should be on for temp tablespace.

Hope it clears you why we need FSC on on temp tablespace. Think those TDA files are OS files created on the fly. Eventhough DB2 is responsible of those TDA files, still DB2 might be handling it has OS files, i suppose.

All the above are my understanding towards FSC, correct me if i was wrong anywhere.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On