WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

23
IBM WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide IBM WPLC Performance Team and IBM Toronto Lab December 18, 2007 RCSfile: wp6wcmdb2-TuningGuide.tex,v Date: 2007/12/18 17:23:34 Revision: 1.3

Transcript of WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

Page 1: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBMWebSphere Portal Version 6.0Web Content Management

andDB2

Tuning Guide

IBM WPLC Performance Team and IBM Toronto Lab

December 18, 2007

RCSfile: wp6wcmdb2-TuningGuide.tex,v Date: 2007/12/18 17:23:34 Revision: 1.3

Page 2: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

Contents

Preface ii

1 Performance Tuning the Environment 1

2 Understanding the Environment 1

3 Application Server Tuning 23.1 JVM Max Heap Size Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . 23.2 JVM Large Page Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33.3 kCluster and pCluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43.4 Datasource Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.5 Application Server Cloning . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 DB2 registry variables 54.1 Optional variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

5 Database Manager configuration parameters 7

6 Database configuration parameters 86.1 Parameters for all databases . . . . . . . . . . . . . . . . . . . . . . . . . . . 86.2 Parameters for the JCR database . . . . . . . . . . . . . . . . . . . . . . . . 9

7 Database Tuning 107.1 Collating Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107.2 changing JCR tables to be not volatile . . . . . . . . . . . . . . . . . . . . . 10

8 Ongoing database maintainence 118.1 runstats and reorg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118.2 Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

8.2.1 Buffer pool analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

9 Directory Server Tuning 14

10 WebSphere Portal Service Properties 15

A Stored Procedures - Buffer Pool Hit Ratio 16A.1 bphr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16A.2 bphr all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

B References 18

C Credits 19

i

Page 3: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

Preface

This document was written with intent to be a central source for tuning a WebspherePortal Web Content Management and DB2 environment.It describes the different parts of the environment that are special to that environment. Itwas written by the IBM WPLC Performance Team and IBM Toronto Lab.

The document describes how to tune the Application Server and the WebSphere Por-tal. Furthermore it points out various registry variables and several database manager anddatabase configuration parameters that should be set to the specified values as a good start.

The ongoing maintenance section is a guideline how to keep the DB2 system performantduring the growth of the system.

ii

Page 4: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

1 Performance Tuning the Environment

Tuning a WebSphere Portal environment involves tuning and configuring the various sys-tems and components of the environment. This chapter discusses some general conceptsand details the specifics of the configuration used in our measurement environment. Thetuning and configuration for the WebSphere Portal Web Content Management (WCM) AIXPower4 measurement environment was based upon the WebSphere Portal AIX Power4 en-vironment detailed in the IBM WebSphere Portal Version 6.0 Tuning Guide. All differencesin the environment used to measure WCM are explicitly mentioned in this chapter. Theoverall tuning and configuration approach to any WebSphere Portal environment includes:

• Configuring the application server and the resources defined for that applicationserver

• Determining the cloning strategy for expanding or extending the environment

• Tuning the database(s) and database server

• Tuning the directory server and its database

• Tuning the web server

• Tuning the operating system and network

• Tuning the WebSphere Portal services

When tuning your individual systems, it is important to begin with a baseline, monitor theperformance metrics to determine if any parameters should be changed and, when a changeis made, monitor the performance metrics to determine the effectiveness of the change.

2 Understanding the Environment

WebSphere Portal V6.0 uses additional servers to provide its functionality. In our measure-ment environment, there is a web server, database server and directory server in additionto the portal server itself. For maximum performance, these servers should reside on sep-arate systems from the WebSphere Portal system. The primary benefit of having such aconfiguration is to avoid resource contention from multiple servers residing on a single sys-tem. Additional servers contending with the WebSphere Portal server for system resourcesimpacts the system’s achievable throughput. The configuration used for the measurementsin this report had the IBM HTTP Server on the same system as WebSphere Portal.See Appendix B: WCM Benchmark Environment for the details of our lab configuration.

Date: 2007/12/18 17:23:34 1 / 20 Revision: 1.3

Page 5: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

3 Application Server Tuning

There are many aspects to configuring and tuning an application server in WebSphereApplication Server. We found that those presented here, and in the IBM WebSpherePortal Version 6.0 Tuning Guide were critical to a correctly functioning and optimally per-forming WebSphere Portal in our laboratory environment. For more details on tuning aWebSphere Application Server, see the Tuning Section of the information center located at:

http://www.ibm.com/software/webservers/appserv/was/library/

The following are settings, based on our experience with the workloads described in thisdocument, which differed from those in the IBM WebSphere Portal Version 6.0 TuningGuide for AIX on the Power4 platform:

Parameter Setting Additional DetailsJava VirtualMachine heapsize

1792 Remember that the value of the JVMHeap size is directly related to theamount of physical memory on thesystem. Never set the JVM heap sizelarger than the physical memory on thesystem

see section 3.1JVM HeapLarge page

-Xlp Used with the IBM JVM to allocatethe heap using large pages.

see section 3.2kCluster andpCluster

-Xk30000-Xp24000k,2400k

Pinned clusters. Pre-allocates JVMheap for class files, since they are oth-erwise pinned in memory once loaded.

see section 3.3

3.1 JVM Max Heap Size Limits

When setting the heap size for an application server, keep the following in mind: Makesure that the system has enough physical memory for all of the processes to fit into physi-cal memory, plus enough for the operating system. When more memory is allocated thanthe physical memory in the system, paging will occur, and this can result in very poorperformance.

While we set the minimum and maximum heap sizes to the same values, this may not

Date: 2007/12/18 17:23:34 2 / 20 Revision: 1.3

Page 6: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

be the best choice for production systems which are running on IBM JDKs. In our mea-surement runs, the system is under load for a relatively short time (around 3 hours), andit is running with portlets which do not have large memory requirements. When usingportlets which will have larger memory requirements, or for continuous operation, it maybe possible to reduce heap fragmentation by setting the initial heap size to 320 megabytes.

After doing any tuning of heap sizes, monitor the system to make sure that paging isnot occurring. As mentioned above, paging can cause poor performance.

How-To Set Parameter:

In the WebSphere Administrative Console: Servers → Application Servers → WebSpherePortal → Server Infrastructure: Java and Process Management → Process Definition →Java Virtual Machine- Initial Heap Size- Maximum Heap Size

3.2 JVM Large Page Tuning

This setting can be used with the IBM JVM to allocate the heap using large pages. AIXoperating system must be configured to support large pages. Using large pages can reducethe CPU overhead needed to keep track of heap. With this tuning, we have seen 10%throughput improvement in our measurements.

How-To Set Parameter:

1. In the WebSphere Administrative Console: Servers → Application Servers → Web-Sphere Portal → Server Infrastructure: Java and Process Management → ProcessDefinition → Java Virtual Machine → Generic JVM Argument, Add: -Xlp

2. In the WebSphere Administrative Console: Servers → Application Servers → Web-Sphere Portal → Server Infrastructure: Java and Process Management → ProcessDefinition → Custom Properties → New → EXTSHM=OFF(note: When EXTSHM is on it prevents use of large page).

3. Stop Portal server

4. Configure AIX to support large pages. We use the following steps to allocate 1856MB of RAM as large pages (16MB). We chose this amount based on having 4GB ofphysical memory in these systems. These values may need to be adjusted on systemswith different amounts of physical memory.vmo -r -o lgpg regions=116 -o lgpg size=16777216

Date: 2007/12/18 17:23:34 3 / 20 Revision: 1.3

Page 7: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

bosboot -areboot -qvmo -p -o v pinshm=1chuser capabilities=CAP BYPASS RAC VMM,CAP PROPAGATE $USER

5. Restart Portal Server. To verify if large pages are being used, run the AIX commandvmstat -l 1 5 and check the ”alp” column which is the active large page used. Itshould be a non-zero value if large pages are being used.

3.3 kCluster and pCluster

Objects that are on the JVM heap are usually mobile; that is, the Garbage Collector canmove them around if it decides to re-sequence the heap. Some objects, however, cannot bemoved either permanently or temporarily. Such immovable objects are known as pinnedobjects.

In release 1.3.1 Service Refresh 7 and above, the Garbage Collector allocates a kClus-ter as the first object at the bottom of the heap. A kCluster is an area of storage that isused exclusively for class blocks. It is large enough to hold 1280 entries. Each class blockis 256 bytes long.

The Garbage Collector then allocates a pCluster as the second object on the heap. ApCluster is an area of storage that is used to allocate any pinned objects. It is 16 KB long.

When the kCluster is full, the Garbage Collector allocates class blocks in the pCluster.When the pCluster is full, the Garbage Collector allocates a new pCluster of 2 KB

Because this new pCluster can be allocated anywhere in the heap and must be pinned,it can cause fragmentation problems. The pinned objects effectively deny the GC the abil-ity to combine free space during heap compaction and could result in a heap that contains alot of free space but in relatively small discrete amounts, so that an allocation that appearsto be well below the total free heap space will fail. To solve this problem, release 1.3.1at SR7, and later, provides command-line options to specify the kCluster (-Xk), pCluster(-Xp) and pCluster overflowsize (-Xp). Use these options to set the initial sizes of the’clusters’ to be large enough to avoid fragmentation issues.

How-To Set Parameter:

In the WebSphere Administrative Console: Servers → Application Servers → WebSpherePortal → Server Infrastructure: Java and Process Management → Process Definition →Java Virtual Machine → Generic JVM Argument: -Xk30000 -Xp24000k,2400k

Date: 2007/12/18 17:23:34 4 / 20 Revision: 1.3

Page 8: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

3.4 Datasource Tuning

As is described in the WebSphere Portal information center, multiple databases are usedwith WebSphere Portal V6.0. We used seven separate databases, each with their owndatasources. These are:

Database Database name Datasource nameRelease release reldbDSCommunity community commdbDSCustomization custom cusdbDSFeedback fdbkdb fdbkdbDSLikeminds lmdb lmdbDSJCR jcrdb jcrdbDSMember Manager wmmdb wmmdbDS

For the prepared statement cache size, the path is Resources→ JDBC Providers→ providername → Data Sources → datasource name → WebSphere Application Server data sourceproperties. The provider name and datasource name are based on the names selected forthat database during the database transfer step. Look for the parameter Statement cachesize.

We set the prepared statement cache size to 1 statement for all Datasources to reducethe demands on native memory, thus avoiding crashes.

3.5 Application Server Cloning

We did not measure any cloned environment for this report.

4 DB2 registry variables

The following registry variables should be set (by using the db2set command) at theinstance level:

DB2_RR_TO_RS=YESDB2_EVALUNCOMMITTED=YESDB2_SKIPDELETED=ONDB2_INLIST_TO_NLJN=YESDB2_MINIMIZE_LISTPREFETCH=ON

DB2 RR TO RS This parameter is deprecated since DB2 v8.2. If you don’t get an errorwhen trying to set the parameter in DB2 higher than version 8.2, it is ok to have it set. Ifyou get an error, never mind. The next two variables are the replacement for it.When DB2 RR TO RS is on, RR behavior cannot be guaranteed for scans on user tables

Date: 2007/12/18 17:23:34 5 / 20 Revision: 1.3

Page 9: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

because next key locking is not done during index key insertion and deletion. Catalog tablesare not affected by this option. The other change in behavior is that with DB2 RR TO RSon, scans will skip over rows that have been deleted but not committed, even though therow may have qualified for the scan.

DB2 EVALUNCOMMITTED When enabled, this variable allows, where possible, tableor index access scans to defer or avoid row locking until a data record is known to satisfypredicate evaluation. DB2 EVALUNCOMMITTED is applicable only to statements using eitherCursor Stability or Read Stability isolation levels. For index scans, the index must be atype-2 index. Furthermore, deleted rows are skipped unconditionally on table scan ac-cess while deleted keys are not skipped for type-2 index scans unless the registry variableDB2 SKIPDELETED is also set.

DB2 SKIPDELETED When enabled, this variable allows statements using either CursorStability or Read Stability isolation levels to unconditionally skip deleted keys during indexaccess and deleted rows during table access. With DB2 EVALUNCOMMITTED enabled, deletedrows are automatically skipped, but uncommitted pseudo-deleted keys in type-2 indexesare not skipped unless DB2 SKIPDELETED is also enabled.

DB2 INLIST TO NLJN Sometimes the optimizer does not have accurate information todetermine the best join method for the rewritten version of the query. This can occur if theIN list contains parameter markers or host variables which prevent the optimizer from usingcatalog statistics to determine the selectivity. This registry variable causes the optimizerto favor nested loop joins to join the list of values, using the table that contributes the INlist as the inner table in the join.

DB2 MINIMIZE LISTPREFETCH Necessary to avoid an inefficient access plan for acommon query on one of the tables in the JCR database.

4.1 Optional variables

If the system, where DB2 is running, is CPU bound, then the following parameter can beset as well. Since this variable affects all statements that have more than 5 joins involved,it should be used with caution. This parameter can help to reduce time and resource usageduring optimization. Although optimization time and resource use might be reduced, therisk of producing a less than optimal data access plan is increased.

DB2_REDUCED_OPTIMIZATION=5

Attention: This parameter should only be set when explicitly advised by IBM.

Date: 2007/12/18 17:23:34 6 / 20 Revision: 1.3

Page 10: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

5 Database Manager configuration parameters

parameter value

QUERY HEAP SZ 32768MAXAGENTS 1000SHEAPTHRES 50000HEALTH MON OFFASLHEAPSZ 60RQRIOBLK 65535FEDERATED NO

As the instance user enter the following commands:

db2 "update dbm cfg using query_heap_sz 32768"db2 "update dbm cfg using maxagents 1000"db2 "update dbm cfg using sheapthres 50000"db2 "update dbm cfg using health_mon off"db2 "update dbm cfg using aslheapsz 60"db2 "update dbm cfg using rqrioblk 65535"db2 "update dbm cfg using federated no"

Note: If you need federated database support, you must not set FEDERATED to NO.

Date: 2007/12/18 17:23:34 7 / 20 Revision: 1.3

Page 11: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

6 Database configuration parameters

6.1 Parameters for all databases

parameter value

APPLHEAPSZ 4096APP CTL HEAP SZ 1024STMTHEAP 8192DBHEAP 2400LOCKLIST 1000LOGFILSIZ 1000LOGPRIMARY 12LOGSECOND 20LOGBUFSZ 128AVG APPLS 5LOCKTIMEOUT 30MAXLOCKS 70MAXAPPLS AUTOMATIC

As the instance user enter the following commands, but change DBNAME to the actualdatabase name:

db2 "update db cfg for DBNAME using applheapsz 4096"db2 "update db cfg for DBNAME using app_ctl_heap_sz 1024"db2 "update db cfg for DBNAME using stmtheap 8192"db2 "update db cfg for DBNAME using dbheap 2400"db2 "update db cfg for DBNAME using locklist 1000"db2 "update db cfg for DBNAME using logfilsiz 1000"db2 "update db cfg for DBNAME using logprimary 12"db2 "update db cfg for DBNAME using logsecond 20"db2 "update db cfg for DBNAME using logbufsz 128"db2 "update db cfg for DBNAME using avg_appls 5"db2 "update db cfg for DBNAME using locktimeout 30"db2 "update db cfg for DBNAME using maxlocks 70"db2 "update db cfg for DBNAME using maxappls automatic"

Date: 2007/12/18 17:23:34 8 / 20 Revision: 1.3

Page 12: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

6.2 Parameters for the JCR database

parameter value

DBHEAP 4800SORTHEAP 4096APPLHEAPSZ 16384APP CTL HEAP SZ 20000STMTHEAP 16384NUM IOCLEANERS 11NUM IOSERVERS 11

As the instance user enter the following commands, but change JCRDB to the name of theJCR database:

db2 "update db cfg for JCRDB using dbheap 4800"db2 "update db cfg for JCRDB using sortheap 4096"db2 "update db cfg for JCRDB using applheapsz 16384"db2 "update db cfg for JCRDB using app_ctl_heap_sz 20000"db2 "update db cfg for JCRDB using stmtheap 16384"db2 "update db cfg for JCRDB using num_iocleaners 11"db2 "update db cfg for JCRDB using num_ioservers 11"

Date: 2007/12/18 17:23:34 9 / 20 Revision: 1.3

Page 13: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

7 Database Tuning

Database performance is very important for obtaining good performance from WCM. Themaintenance tasks and practices mentioned here and in the IBM WebSphere Portal Ver-sion 6.0 Tuning Guide were found to be critical to the performance and correct operationof WebSphere Portal in our lab environment. Additional database maintenance and tun-ing may be needed in your production environments. For further information on DB2administration, tuning, and monitoring refer to the DB2 Information Center.

7.1 Collating Sequence

DB2 offers a choice of collating sequences when creating databases. We have found thatthis choice can have a performance impact. While the use of UCA400 NO collation hadvirtually no effect on the throughput for the scenario described in this report, it yieldedmuch higher database CPU costs. But in a separate investigative measurement the use ofthe UCA400 NO collation had an obvious impact on some WCM authoring transactions.As a rule of thumb, the need for special locale specific data ordering should be weighedagainst some possible higher database CPU cost. We did not specify any COLLATE optionwhen we created our databases.

7.2 changing JCR tables to be not volatile

The DB2 configuration of the JCR schema marks most of the tables as having VOLATILECARDINALITY. This is true during the initial population since many tables grow fromzero or a few rows to many rows. This attribute is an indication to the DB2 optimizerto not trust the table statistics indicating that the table is very small since the optimizerwould normally choose scanning the table over utilizing an index for a small table. Oncethe database has reached a steady state we want the optimizer to choose the best accessplan according to the catalog statistics (see the following section for recommendations onhow to maintain these statistics). In order to accomplish this we ran the following com-mands:

db2 -x -r "nonVolatile.db2" "select rtrim(concat(’alter table ’,concat(rtrim(tabSchema), concat(’.’, concat(rtrim(tabname),’ not volatile’))))) from syscat.tables where type=’T’ andvolatile=’C’ and tabSchema=’JCR’"

db2 -v -f "nonVolatile.db2"

Date: 2007/12/18 17:23:34 10 / 20 Revision: 1.3

Page 14: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

8 Ongoing database maintainence

8.1 runstats and reorg

Two of the database attributes, which DB2 relies upon to perform optimally, are thedatabase catalog statistics and the physical organization of the data in the tables. Catalogstatistics should be recomputed periodically during the life of the database, particularlyafter periods of heavy data modifications (inserts, updates, and deletes) such as a popu-lation phase. Due to the heavy contention of computing these statistics, we recommendperforming this maintenance during off hours, periods of low demand, or when the portalis off-line. The DB2 runstats command is used to count and record the statistical detailsabout tables, indexes and columns. We have used two techniques in our environment tocompute these statistics. The form we recommend is:

db2 runstats on table tableschema.tablename on all columns with distributionon all columns and sampled detailed indexes all allow write access

These options allow the optimizer to determine optimal access plans for complex SQL.A simpler, more convenient technique for computing catalog statistics is:

db2 reorgchk update statistics on table all

Not only does this command count and record some of the same catalog statistics, it alsoproduces a report that can be reviewed to identify table organization issues. However, wehave found instances where this produces insufficient information for the optimizer to selectan efficient access plan for complex SQL, particularly for queries of the JCR database. Wehave determined a technique that has the same convenience of the reorgchk command andprovides the detailed statistics preferred by the optimizer.

db2 -x -r "runstats.db2" "select rtrim(concat(’runstats on table’,concat(rtrim(tabSchema), concat(’.’,concat(rtrim(tabname),’ on all columns with distribution on all columns and sampled detailedindexes all allow write access’))))) from syscat.tables where type=’T’"

db2 -v -f "runstats.db2"

Reorganizing all the tables would be over-kill in a production environment. To determinewhich tables might benefit from reorganization, use the command:

db2 reorgchk current statistics on table all > "reorgchk.txt"

The tables that need reorganization are indicated by a ∗ in at least one of the three columnsnext to the table name. For those tables that require reorganization, use the command:

db2 reorg table tableschema.tablename

to reorganize the table based upon its primary key.

Date: 2007/12/18 17:23:34 11 / 20 Revision: 1.3

Page 15: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

8.2 Monitoring

Snapshot monitoring is used to identify the behavior of a database over a period of time.It is further used for fine-tuning the system and finding problems regarding performance.

For snapshot monitoring to work, you need to active the different monitors first. There aretwo ways to do this. You can either configure the database manager to activate monitor-ing at instance level, or you can turn on monitoring at a specific time for the current session.

To turn on default monitoring at instance activation or instance level use the followingcommand:

db2 update dbm cfg using DFT_MON on

where DFT MON is one of the following values:

DFT_MON_BUFPOOL DFT_MON_LOCK DFT_MON_SORT DFT_MON_STMTDFT_MON_TABLE DFT_MON_TIMESTAMP DFT_MON_UOW

To turn on monitoring for the current session use the command:

db2 update monitor switches using MON_SWITCH on

where MON SWITCH is one of the following values:

monitor value

Buffer Pool Activity Information BUFFERPOOLLock Information LOCKSorting Information SORTSQL Statement Information STATEMENTTable Activity Information TABLETake Timestamp Information TIMESTAMPUnit of Work Information UOW

Note: Since activated monitors increase the utilisation of the CPU, you should activateall monitors only when needed.

To get the currently activated monitor switches use the following command:

db2 get monitor switches

Date: 2007/12/18 17:23:34 12 / 20 Revision: 1.3

Page 16: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

To get a snapshot for a database, run the following command:

db2 get snapshot for all on DBNAME >snap.out

Another way to monitor a DB2 system is db2top. You can get this utility at:

http://www.alphaworks.ibm.com/tech/db2top

8.2.1 Buffer pool analysis

A buffer pool is memory used to cache table and index data pages as they are being readfrom disk, or being modified. The buffer pool improves database system performance byallowing data to be accessed from memory instead of from disk. Because memory accessis much faster than disk access, the less often the database manager needs to read from orwrite to a disk, the better the performance.

Since there is no SYSIBMADM.BP HITRATIO table in DB2 v8, I’ve written two stored proce-dures1, for calculating the buffer pool hit ratio:

stored procedure description

bphr shows the bufferpool hit ratio of the actualdatabase

bphr all shows the bufferpool hit ratio of all activedatabases within the instance

The stored procedure is invoked with the following command:

db2 call SPNAME

where SPNAME is the name of the stored procedure.

You can download the latest version of the stored procedures at:

http://www.evermeet.cx/cvs/db2scripts/

They are installed (after connecting to a database) with the following command:

db2 -td@ -f bphr.db2

1see Appendix A

Date: 2007/12/18 17:23:34 13 / 20 Revision: 1.3

Page 17: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

In DB2 9, you can either use the two stored procedures, or the following SQL statementto get the buffer pool hit ratio:

db2 "select snapshot_timestamp, substr(db_name,1,10) as dbname,substr(bp_name,1,18) as bufferpool, total_hit_ratio_percent as total,data_hit_ratio_percent as data, index_hit_ratio_percent as indexfrom sysibmadm.bp_hitratio"

An ideal buffer pool hit ratio is above 96%. It would be well worthwhile to increase thesize of the buffer pool and see if the hit ratio increases. If the hit ratio remains low, youmay need to redesign your logical layout of your table spaces and buffer pools.

The size of the buffer pool can be changed online by the following command:

db2 alter bufferpool BPNAME immediate size NUMBER_OF_PAGES

9 Directory Server Tuning

Our measurements used IBM Tivoli Directory Server (ITDS) version 5.2 as the directoryserver. The configuration details are the same of the AIX ITDS V5.2 directory serverconfiguration specified in the IBM WebSphere Portal Version 6.0 Tuning Guide.

Date: 2007/12/18 17:23:34 14 / 20 Revision: 1.3

Page 18: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

10 WebSphere Portal Service Properties

WebSphere Portal has a number of configurable ”services”; each service has several pa-rameters available to it. This section describes which services we tuned different from thatdescribed in the IBM WebSphere Portal Version 6.0 Tuning Guide.

The only service we tuned differently was the Cache Manager Service. For this servicewe accepted the defaults shipped with WebSphere Portal except for the changes listed inthe following table:

Cache Name AIX POWER4 WCMRendering Scenario

com.ibm.wps.ac.ExplicitEntitlementsCache.ICM CONTENT.size

2000

com.ibm.wps.datastore.services.Identification.SerializedOidStringCache.size

5000

com.ibm.wps.model.content.impl.ResourceCache.lifetime

14400

Date: 2007/12/18 17:23:34 15 / 20 Revision: 1.3

Page 19: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

A Stored Procedures - Buffer Pool Hit Ratio

A.1 bphr

CREATE PROCEDURE bphr ()SPECIFIC tessus_bphr LANGUAGE SQL DYNAMIC RESULT SETS 1

BEGINDECLARE res CURSOR WITH RETURN FOR

WITH bp_snap (snapshot_timestamp, database, bufferpool, bp_hr, data_hr,idx_hr, page_clean_ratio )

AS(SELECT snapshot_timestamp, SUBSTR(db_name,1,16), SUBSTR(bp_name,1,32),CASEWHEN ((pool_data_p_reads > 0 OR pool_index_p_reads > 0) AND

(pool_data_l_reads > 0 OR pool_index_l_reads > 0))THENDECIMAL( ((1-(double(pool_data_p_reads + pool_index_p_reads)/DOUBLE(pool_data_l_reads + pool_index_l_reads+1)) )*100.0),3,1 )

ELSENULL

END CASE,CAST( (CAST( pool_data_l_reads - pool_data_p_readsAS DOUBLE)*100.0)/(pool_data_l_reads+1) AS DECIMAL(3,1)),

CAST( (CAST( pool_index_l_reads - pool_index_p_readsAS DOUBLE)*100.0)/(pool_index_l_reads+1) AS DECIMAL(3,1)),

CAST( (CAST( pool_async_data_writes + pool_async_index_writesAS DOUBLE)*100.0)/(pool_data_writes+pool_index_writes+1)AS DECIMAL(3,1))

FROM TABLE(snapshot_bp(’’,-1)) AS BPORDER BY 2,3

)SELECT snapshot_timestamp, database, bufferpool, bp_hr, data_hr, idx_hrFROM bp_snap;

OPEN res;END@

Date: 2007/12/18 17:23:34 16 / 20 Revision: 1.3

Page 20: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

A.2 bphr all

CREATE PROCEDURE bphr_all ()SPECIFIC tessus_bphr_all LANGUAGE SQL DYNAMIC RESULT SETS 1

BEGINDECLARE res CURSOR WITH RETURN FOR

WITH bp_snap (snapshot_timestamp, database, bufferpool, bp_hr, data_hr,idx_hr, page_clean_ratio )

AS(SELECT snapshot_timestamp, SUBSTR(db_name,1,16), SUBSTR(bp_name,1,32),CASEWHEN ((pool_data_p_reads > 0 OR pool_index_p_reads > 0) AND

(pool_data_l_reads > 0 OR pool_index_l_reads > 0))THENDECIMAL( ((1-(double(pool_data_p_reads + pool_index_p_reads)/DOUBLE(pool_data_l_reads + pool_index_l_reads+1)) )*100.0),3,1 )

ELSENULL

END CASE,CAST( (CAST( pool_data_l_reads - pool_data_p_readsAS DOUBLE)*100.0)/(pool_data_l_reads+1) AS DECIMAL(3,1)),

CAST( (CAST( pool_index_l_reads - pool_index_p_readsAS DOUBLE)*100.0)/(pool_index_l_reads+1) AS DECIMAL(3,1)),

CAST( (CAST( pool_async_data_writes + pool_async_index_writesAS DOUBLE)*100.0)/(pool_data_writes+pool_index_writes+1)AS DECIMAL(3,1))

FROM TABLE(snapshot_bp(CAST(NULL AS VARCHAR(128)),-1)) AS BPORDER BY 2,3

)SELECT snapshot_timestamp, database, bufferpool, bp_hr, data_hr, idx_hrFROM bp_snap;

OPEN res;END@

Date: 2007/12/18 17:23:34 17 / 20 Revision: 1.3

Page 21: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

B References

WebSphere Portal Information Center:http://www.ibm.com/developerworks/websphere/zones/portal/proddoc.html

WebSphere Application Server Information Center:http://www.ibm.com/software/webservers/appserv/was/library/

DB2 Information Center:http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsphttp://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsphttp://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp

IBM WebSphere Portal Version 6.0 Tuning Guide:http://www-1.ibm.com/support/docview.wss?rs=688&uid=swg27008511

IBM WebSphere Portal Version 6.0 Benchmark Results and Tuning Guide is availableby request from the WPLC Performance Team.

IBM WebSphere Portal Version 6.0 Document Manager Benchmark Results and TuningGuide is available by request from the WPLC Performance Team.

For additional performance-related information, consult the following resources:

WebSphere Application Server Performance information:http://www.ibm.com/software/webservers/appserv/was/performance.html

Recommended reading list: J2EE and WebSphere Application Serverhttp://www.ibm.com/developerworks/websphere/library/techarticles/0305_issw/recommendedreading.html

WebSphere Application Server Development Best Practices for Performance and Scala-bility:http://www.ibm.com/software/webservers/appserv/ws_bestpractices.pdf

Diagnosing Performance Problems for WebSphere Portal 5.1 (though this document waswritten for WebSphere Portal 5.1, the lessons apply to WebSphere Portal 6.0 as well):http://www.ibm.com/support/docview.wss?uid=swg27007059

IBM Developer Kit and Runtime Environment, Java(TM) 2 Technology Edition, Version1.4.2 Diagnostics Guidehttp://www-128.ibm.com/developerworks/java/jdk/diagnosis/142.html

Date: 2007/12/18 17:23:34 18 / 20 Revision: 1.3

Page 22: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

C Credits

Thanks to the following team members of the WPLC Performance Team for contributingto this document.

Mark Alkins, manager

Nathan Cook, report author

Rich Hall, report author

Andrew Citron

Susan Hanis

Ruthie Lyle

Denny Pichardo

Martin Presler-Marshall

Evan Thompson

Terence Walker

Laura Yen

Thanks to the following people from the IBM Toronto Lab.

Helmut K. C. Tessarek, DB2 Performance, report author

Date: 2007/12/18 17:23:34 19 / 20 Revision: 1.3

Page 23: WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide

IBM WebSphere Portal Web Content Manager and DB2 Tuning Guide

c© Copyright IBM Corporation 2006-2007

IBM United States of America

Produced in the United States of America

All Rights Reserved

The e-business logo, the eServer logo, IBM, the IBM logo, IBM Directory Server, DB2, Lotus, WebSphere, POWER4and POWER5 are trademarks of International Business Machines Corporation in the United States, other countriesor both.

Lotus and Domino are trademarks of Lotus Development Corporation and/or IBM Corporation.

The following are trademarks of other companies:

Linux is a registered trademark of Linus Torvalds.

Solaris, Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the UnitedStates, other countries or both.

Windows and Windows 2003 Enterprise Server are trademarks of Microsoft Corporation in the United States and/orother countries

Oracle 10 and all Oracle-based trademarks and logos are trademarks of the Oracle Corporation in the United States,other countries or both.

LoadRunner is a trademark of Mercury in the United States and/or other countries.

Other company, product and service names may be trademarks or service marks of others.

INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PAPER ”AS IS” WITHOUTWARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTIC-ULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions,therefore, this statement may not apply to you.

Information in this paper as to the availability of products (including portlets) was believed accurate as of thetime of publication. IBM cannot guarantee that identified products (including portlets) will continue to be madeavailable by their suppliers.

This information could include technical inaccuracies or typographical errors. Changes may be made periodicallyto the information herein; these changes may be incorporated in subsequent versions of the paper. IBM may makeimprovements and/or changes in the product(s) and/or the program(s) described in this paper at any time withoutnotice.

Any references in this document to non-IBM web sites are provided for convenience only and do not in any mannerserve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for thisIBM product and use of those Web sites is at your own risk.

IBM may have patents or pending patent applications covering subject matter described in this document. Thefurnishing of this document does not give you any license to these patents. You can send license inquiries, in writing,to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY, USA 10504-1785

Date: 2007/12/18 17:23:34 20 / 20 Revision: 1.3