Request More Information

We are hiring!

Xtivia, Inc.
2012 North America Liferay Partner of the Year

Join our top-notch team of Enterprise Java and Liferay Portal professionals in our Austin, TX office or work remotely! Please check out our current Dice listings.

Recent Bloggers

Bob Dietrich
Posts: 1
Stars: 0
Date: 6/14/13
KL Hamilton
Posts: 3
Stars: 0
Date: 6/6/13
Luke Smith
Posts: 9
Stars: 0
Date: 5/24/13
Brian Fairchild
Posts: 19
Stars: 0
Date: 5/16/13
Mangesh Mharolkar
Posts: 10
Stars: 0
Date: 5/7/13
Barrie Shaw
Posts: 4
Stars: 0
Date: 4/17/13
Andrew Dalby
Posts: 2
Stars: 0
Date: 4/5/13
Tina Xing
Posts: 1
Stars: 0
Date: 3/29/13
Kaushik Nagaraj
Posts: 7
Stars: 0
Date: 3/27/13
Asier Del Pozo
Posts: 3
Stars: 0
Date: 3/27/13
« Back

Speed up DB2 database restore on AIX

Hello,

I wanted to share some lessons learned with AIX kernel parameters and DB2 database restore performance. 

We have a client with a 21 GB database on AIX version 6.1 and DB2 9.7 fixpack 6.  The server has 8 quad-core CPU and 32 GB of memory.  This is a very powerful system for a small database so you would think database backups and restores would be very quick.  Well, the database backup took about 5 minutes but the database restore was taking about 5 HOURS!!!

After some troubleshooting with system administrators it was obvious that there was disk contention and that jfs logging was thrashing.  The first change that was made was to jfs2 logging.

The system admin pointed all jfs2 logging of the db2 filesystems (/db2data, /db2backups, /db2logs) to point to /dev/null.  I then created a new folder called /db2data/tmp and made these changes to the instance owners profile. 

TMP=/db2data/tmp

TMPDIR=/db2data/tmp

TEMP=/db2data/tmp

export TMP TEMP TMPDIR

These two changes to the jfs2 logging improved the database restore from 5 hours to 2.5 hours.  A big improvement but still not good enough.

The next change was to two of the Asynchrounous I/O tunable kernel parameters in AIX.  MAXREQS and MAXSERVERS.  They are not DB2 specific but IBM does make recommendations for DB2 server workload.  Here are the definitions according to the pSeries Information Center:

MAXREQS:
Purpose: Specifies the maximum number of asynchronous I/O requests that can be outstanding at any one time.

MAXSERVERS
Purpose: Specifies the maximum number of AIO kprocs per processor.

We changed MAXSERVERS from 30 to 40.  This may have helped a little but it wasn't a huge change.  We also changed MAXREQS from the default of 4096 to 7936.  MAXREQS should be at 256 times the number of IO_CLEANERS set in DB2.  NUM_IOCLEANERS was set to AUTOMATIC and a value of 31 (remember 8x4 CPU's).  So, 256 x 31 is 7936, replacing the default of 4096.

This improved restore time to 4 minutes!!.   And general database I/O is much improved.  For example a large table load operation that took several hours now takes a few minutes.

   

I believe that tuning the AIX Asynch IO parameters and the previous changes to JFS disk logging were what improved performance.  I'm very glad to have learned what a difference these settings can make with a DB2 restore and general I/O.

 

(Please see my follow up entry called PART 2)

Comments
Trackback URL:

Anonymous User
Hello, Brian

Thank you for sharing this info.

Is there AIX 6.1 really ? I ask because as i know 6.1 have "ioo" tunable aix_maxreqs=65536 by default and 5.3 have "aioo" tunable (removed in 6.1) maxreqs=4096 by default. Also, according to your part2, the aio0 device is removed from AIX ODM in 6.1.
Posted on 8/3/12 2:48 AM.
Anonymous User
Hello Brian,
thank you for the info!

I think that it is not AIX 6.1 as in previous comment said.
The Best Practice for Tuning AIX 6.1 for DB2 is there:
http://www.redbooks.ibm.com/Redbooks.nsf/RedpieceAbstracts/sg247821.html?O­pen
Posted on 8/7/12 7:40 AM in reply to Anonymous User.
Anonymous User
It is definitely AIX 6.1. But I'm not sure why maxreqs wasn't set to how we would expect it. I'll follow up with the system admin.

$ oslevel
6.1.0.0
$ ioo -a
aio_active = 1
aio_maxreqs = 7936
aio_maxservers = 40
aio_minservers = 3
aio_server_inactivity = 300
j2_atimeUpdateSymlink = 0
j2_dynamicBufferPreallocation = 16
j2_inodeCacheSize = 400
j2_maxPageReadAhead = 128
j2_maxRandomWrite = 2
j2_metadataCacheSize = 400
j2_minPageReadAhead = 2
j2_nPagesPerWriteBehindCluster = 128
j2_nRandomCluster = 128
j2_syncPageCount = 0
j2_syncPageLimit = 16
lvm_bufcnt = 9
maxpgahead = 8
maxrandwrt = 0
numclust = 1
numfsbufs = 196
pd_npages = 65536
posix_aio_active = 0
posix_aio_maxreqs = 65536
posix_aio_maxservers = 30
posix_aio_minservers = 3
posix_aio_server_inactivity = 300
Posted on 8/7/12 11:04 AM in reply to Anonymous User.

Request More Information