DB2 for z/OS performance depends on a careful balance: keep frequently needed information in memory, but never promise more memory than the LPAR can safely provide. This tutorial explains the subsystem and runtime controls behind buffer pools, EDM caches, thread and RID storage, sorting, and the work file database. It is written for beginners, but it also gives you the vocabulary needed to read installation panels, DSNZPARM reports, and Db2 statistics.
A subsystem parameter, often called a ZPARM, gives Db2 a startup value, default, or limit. Installation and migration panels such as DSNTIP1 and DSNTIP2 collect choices and generate the corresponding settings. A runtime command can control a particular resource more directly. These layers are related, but they are not interchangeable.
Before changing anything, capture the active DSNZPARM report, the relevant DISPLAY output, statistics over representative busy periods, and the LPAR's real-storage health. Parameter names, ranges, defaults, and whether a change is online can vary by Db2 release. The values in this lesson explain intent; the IBM documentation for your exact release remains the authority.
A buffer pool is DBM1 virtual storage divided into equal-size buffers. Table space and index pages are read into those buffers and reused without another disk read while they remain resident. During installation, the DSNTIP1 and DSNTIP2 workflow supplies initial sizes for the pools Db2 starts. Those initial values help create a working subsystem, but production sizing should later follow measured I/O, hit ratios, prefetch activity, page residency, and real storage.
| Parameter or option | Values | What it controls |
|---|---|---|
| DSNTIP1 / DSNTIP2 initial sizes | Install or migration panel values | Establish the initial allocation for buffer pools when Db2 is installed or migrated. Treat these values as a starting profile, not permanent tuning decisions. |
| VPSIZE | Positive integer number of buffers | Sets the active virtual pool size. The byte requirement depends on both the buffer count and the pool page size: 4 KB, 8 KB, 16 KB, or 32 KB. |
| VPSEQT | 0–100 percent | Maximum portion of the pool available to sequentially accessed pages. A lower value protects random-access pages; 0 disables ordinary sequential steal behavior. |
| VPPSEQT | 0–100 percent of the sequential area | Limits how much of the sequential area a single parallel operation can use. It prevents one parallel query from dominating the pool. |
| DWQT | Percentage threshold | The deferred-write threshold for the entire pool. Crossing it causes Db2 to schedule writes of changed pages so dirty buffers do not accumulate without control. |
| VDWQT | Percentage and optional buffer count | The vertical deferred-write threshold applies to changed pages for one page set. It helps prevent one object from consuming too many writable buffers. |
| PGSTEAL | LRU, FIFO, or NONE | Chooses the page replacement strategy. LRU favors recently used pages, FIFO uses arrival order with lower management overhead, and NONE is designed to keep an entire stable page set resident. |
| PGFIX | YES or NO | YES fixes pool frames in real storage and can reduce CPU used for page fixing, but it commits real memory. NO allows pageable backing and is safer when real storage is constrained. |
| FRAMESIZE | 4K, 1M, or 2G where supported | Selects the real-storage frame size. Large frames can improve translation efficiency, but require suitable z/OS configuration and enough contiguous large-frame resources. |
| AUTOSIZE | YES or NO | Allows Db2 to adjust the pool within defined boundaries. Automatic sizing still needs sensible limits and monitoring; it is not unlimited memory. |
| VPSIZEMIN / VPSIZEMAX | Minimum and maximum buffer counts | Bound an automatically sized pool. The minimum protects a working baseline, while the maximum prevents growth from taking more storage than the subsystem can safely support. |
VPSIZE is a count, not a number of megabytes. A 100,000-buffer 4 KB pool represents roughly 400 MB of page frames before management overhead, while the same count in a 32 KB pool represents roughly 3.2 GB. That multiplication is why copying a VPSIZE from BP0 to BP32K is dangerous. With AUTOSIZE enabled, Db2 can move between VPSIZEMIN and VPSIZEMAX. Set a minimum large enough for the pool's essential working set and a maximum that remains safe when several pools and threads grow at once.
VPSEQT divides pool capacity between sequential and random-style use. Sequential prefetch can be efficient, yet one scan should not flush every hot index page. VPPSEQT adds protection against a single parallel query taking the whole sequential allocation. These thresholds do not make SQL good or bad; they govern competition after the optimizer chooses an access path.
Changed pages are not necessarily written to disk at each SQL update. They become deferred-write pages. DWQT watches the changed-page level across the pool, while VDWQT watches concentration for an individual page set. Lower thresholds initiate writes earlier and can smooth a burst, but may increase write activity. Higher thresholds allow more accumulation, but leave fewer clean buffers and can create a write surge. Log records still provide recoverability; these thresholds manage data-page write timing, not whether logging occurs.
| Option | Typical fit | Behavior and trade-off |
|---|---|---|
| LRU | Mixed or unpredictable access | Keeps recently referenced pages and is the general-purpose choice, with some CPU cost to track recency. |
| FIFO | Large sequential streams with little reuse | Lower replacement-management overhead, but an older useful page can be removed simply because it arrived first. |
| NONE | A dedicated pool sized for the complete page set | Avoids normal stealing after the object is resident. If the pool cannot hold the intended pages, performance can be worse and allocation can fail to meet the design goal. |
PGSTEAL(NONE) is not a magic "never perform I/O" switch. It works when a pool is dedicated and sized to contain the intended object or objects. LRU is appropriate for most mixed workloads. FIFO can help streaming workloads whose pages are unlikely to be reused. Validate a change with synchronous reads, prefetch reads, CPU, and residency rather than one hit-ratio number.
PGFIX(YES) keeps the buffer pool's backing frames fixed in real storage. This can save CPU on a high-activity pool because z/OS does less page-fix work. FRAMESIZE chooses ordinary 4 KB frames or large 1 MB and, where the environment and release support it, 2 GB frames. Large frames reduce translation-lookaside-buffer pressure and page-table work. They are performance tools, not free capacity: the z/OS large-frame pools must be configured and monitored.
Estimate the total fixed commitment across every member and every fixed pool. If the LPAR begins paging because too much memory is fixed or resident, response time can collapse. Buffering intended to avoid disk I/O has then caused a more expensive paging workload.
Installation-panel and ZPARM values establish the initial environment. The active pool is managed with the Db2 command ALTER BUFFERPOOL. A site may alter a pool online after startup and keep that operational definition in automation. Therefore, never assume that an old DSNTIP worksheet describes the current VPSIZE.
12345678910-ALTER BUFFERPOOL(BP8K1) VPSIZE(120000) VPSEQT(60) VPPSEQT(40) DWQT(30) VDWQT(5) PGSTEAL(LRU) PGFIX(YES) FRAMESIZE(1M) -DISPLAY BUFFERPOOL(BP8K1) DETAIL -- Illustrative commands only: -- validate syntax, ranges, online-change behavior, and memory capacity -- for your installed DB2 for z/OS release.
TBSBPOOL and IDXBPOOL are different again: they define default buffer pools for newly created table spaces and indexes when object DDL does not name a pool. TBSBPOOL keeps new table data from silently falling into an unsuitable general pool; IDXBPOOL does the same for indexes. Explicit object DDL can override the defaults. Existing objects do not automatically move just because a default changes.
12345678-- Object-level assignments override subsystem/database defaults CREATE TABLESPACE ORDERTS IN APPDB BUFFERPOOL BP8K1; CREATE INDEX APP.IX_ORDER_CUSTOMER ON APP.ORDERS (CUSTOMER_ID) BUFFERPOOL BP4K2;
EDM means Environmental Descriptor Manager. Db2 needs executable and descriptive structures for SQL statements, plans, packages, and database descriptors. If these structures are cached, Db2 can reuse them. If they are absent or evicted too quickly, Db2 must load, allocate, or prepare them again, increasing CPU and directory activity.
| Area or parameter | Why it matters | What to measure |
|---|---|---|
| EDM statement cache | Retains prepared dynamic SQL structures so repeated statements can avoid a full prepare and access-path selection. | Dynamic statement cache requests, hits, misses, evictions, and prepare CPU. |
| DBD cache | Caches database descriptors that describe Db2 objects. EDMDBDC controls or influences this cache according to the Db2 release. | DBD requests, cache hits, loads from the directory, and storage pressure. |
| Skeleton pool | Keeps skeleton package and plan control structures that Db2 needs before or while executable sections are used. | Package or plan requests, skeleton hits, misses, and repeated loads. |
| EDMPOOL historical parameter | Older Db2 levels used one prominent EDM pool size. Modern releases divide and manage EDM-related storage differently, so old advice must be mapped to the installed release. | Current IBM documentation, subsystem statistics, and release-specific installation panels. |
The EDM statement cache is especially important for dynamic SQL. A cached dynamic statement can reuse prepared form and, when valid, its access path. The DBD cache avoids repeatedly retrieving database descriptors. The skeleton pool supports the package and plan structures that lead to executable sections. EDMDBDC is associated with DBD cache sizing in modern Db2 terminology, while EDMPOOL is frequently encountered in older manuals and inherited standards. Do not insert a historical EDMPOOL recommendation into a current release without checking how storage was separated and converted.
A basic hit ratio is hits ÷ requests × 100. For example, 990,000 cache hits from 1,000,000 requests produce a 99% ratio. That sounds excellent, but the remaining 10,000 misses may still matter if they cluster during peak time or cause expensive prepares. Track requests, hits, misses, not-found conditions, full-cache events, evictions, and prepare or load CPU together. Compare equal workload windows before and after a controlled change.
Also look for causes outside sizing. Frequent package invalidation, constantly changing literal SQL, inconsistent special registers, or an application that never reuses statements can limit cache value. More storage cannot create reuse that the workload does not have.
Virtual storage gives Db2 a large addressable range, but performance ultimately depends on real memory. Add buffer pools, EDM areas, RID and sort resources, thread storage, compression dictionaries, LOB/XML work areas, and subsystem control blocks. Then consider concurrency: one thread's modest requirement multiplied by thousands of threads is no longer modest.
| Parameter or area | Role | Sizing caution |
|---|---|---|
| CONTSTOR | Controls continuous storage management behavior intended to reduce fragmentation and return or contract storage under supported conditions. | Do not change it from old tuning folklore; verify its meaning and recommendation for the active Db2 release. |
| MINSTOR | Influences whether Db2 minimizes storage use for thread-related structures when threads become inactive. | Saving storage can add CPU when structures must be rebuilt. The right choice depends on thread counts and memory pressure. |
| Thread storage | Each active or inactive thread needs control blocks and SQL execution storage; complex statements and high concurrency increase the total. | Size for peak concurrent work, not only the average number of connected users. |
| RID pool / MAXRBLK | Limits storage available for record identifier lists used by list prefetch, multi-index access, and related processing. | Too little can cause RID processing to fail or spill to the work file; too much reserves capacity that competes with other DBM1 needs. |
| SORTPOOL | Controls in-memory sort resources used by SQL operations such as ORDER BY, GROUP BY, joins, and some utility processing. | A larger value may avoid external sort work, but multiply the possible use by concurrent sorts before increasing it. |
| LOB/XML storage knobs | LOB and XML processing can require dedicated buffers, control structures, and temporary work areas, depending on the feature and release. | Tune from observed LOB/XML workloads and release documentation rather than applying ordinary row-data assumptions. |
CONTSTOR and MINSTOR address storage-management behavior rather than SQL semantics. MINSTOR can reduce storage retained for inactive threads, at the possible cost of allocating structures again when work resumes. CONTSTOR has evolved with Db2 storage architecture and is commonly discussed in the context of fragmentation and contraction. These are release-sensitive controls; use current IBM recommendations and observe both CPU and DBM1 storage before changing them.
Thread storage depends on statement complexity, package characteristics, cursor activity, and whether distributed threads remain inactive. Connection pooling may reduce connection cost but still leave many Db2 threads eligible for storage. Measure high-water marks and peak concurrent active work, not just sign-on counts.
A RID is a record identifier that points to a row location. Db2 can build RID lists for list prefetch, multiple-index access, and other operations. MAXRBLK limits the RID pool's storage in the units defined by the installed release. If insufficient memory is available, a RID list can overflow to the work file database or the access method can be abandoned. That adds I/O and can explain why an apparently index-driven query still uses temporary space.
ORDER BY, GROUP BY, DISTINCT, joins, and materialization can require a sort. SORTPOOL provides in-memory sorting capacity, but it is not simply one permanent sort area for the whole subsystem. Concurrent operations can multiply demand, and larger sorts can spill to work files. Tune using sort counts, records sorted, elapsed time, and work file I/O.
LOB and XML data use specialized storage and processing paths. Their related subsystem controls vary more across Db2 releases, so this lesson keeps them at overview level: account for LOB/XML buffers, locators, parsing or serialization work, and temporary space separately from ordinary 4 KB row pages. Monitor the actual feature counters before adjusting any LOB/XML-specific knob.
The Db2 work file database is the subsystem's temporary workshop. It holds intermediate rows that do not belong in an application's permanent table space. Sort runs, RID-list overflow, materialized intermediate results, some join work, and declared global temporary tables can all need work file pages. A fast SQL access path can still fail if temporary capacity is exhausted.
| Parameter or resource | Values or form | Explanation |
|---|---|---|
| MAXTEMPS | Maximum temporary database storage per agent, expressed in the release-defined units | Limits temporary space consumed by one agent. It protects the subsystem from a runaway query, but an overly low limit can stop legitimate reporting or batch work. |
| WFDBSEP | YES or NO | Controls work file database separation behavior, particularly the relationship between temporary work and declared global temporary table usage. Exact allocation rules are release-specific. |
| Work file table spaces | 4 KB and 32 KB spaces, with sufficient underlying disk | Db2 selects suitable work file objects for temporary rows. Capacity must cover expected sort, RID, SQL, and temporary-table peaks without exhausting disk. |
MAXTEMPS protects shared capacity by limiting how much temporary database storage one agent may consume. It is a guardrail, not a substitute for tuning SQL. When a legitimate query reaches the limit, investigate its access path, sort requirements, intermediate result size, and concurrency before merely raising MAXTEMPS.
WFDBSEP governs separation within work file processing, including how declared global temporary table activity is kept apart from other temporary work according to release capabilities. Separation can improve predictability and administration, but it requires properly defined work file table spaces. Check current documentation before changing WFDBSEP because details and migration behavior are version-specific.
More cache can reduce I/O only while real memory is available. Oversizing every pool and per-thread limit creates a false sense of safety. If z/OS must page DBM1 memory out and back in, the subsystem pays paging I/O, CPU, and unpredictable delays. Fixed large-frame pools make the capacity decision even more explicit because that real storage cannot be casually reclaimed.
Tune one constrained resource at a time. Record a baseline, predict the expected counter change, apply a reversible adjustment, and measure the same workload window. A lower synchronous-read count with stable paging and CPU is evidence. A prettier configured value is not.
1234567A practical review sequence 1. Capture active ZPARMs and buffer pool definitions. 2. Measure peak real storage, paging, I/O, cache misses, and work file use. 3. Identify the constrained resource and the SQL or objects driving it. 4. Estimate total bytes, including page size and concurrency multipliers. 5. Change one bounded setting and verify during a comparable workload. 6. Keep rollback values and document the operational command.
Imagine DB2 runs a busy kitchen. Buffer pools are counters where cooks keep ingredients they use often. The EDM area is the recipe stand, so cooks do not fetch the same recipe every time. The RID pool is a list of shelf locations, SORTPOOL is a table for arranging items, and the work file database is extra temporary counter space. Bigger counters help until they fill the whole kitchen. If there is no room to walk, everyone becomes slower. Good DBAs give each station enough space, watch the busiest dinner service, and expand only the station that is crowded.
1. What does VPSIZE define?
2. Which PGSTEAL option is the normal general-purpose choice for mixed access?
3. Why can PGFIX(YES) be risky?
4. Why does the EDM area matter?
5. What can happen when the RID pool is too small?
6. What is the safest basis for sizing work file space?
Build the foundation for understanding how Db2 caches data and index pages.
Apply workload measurements to pool separation, sizing, and performance tuning.
Learn how subsystem parameters are generated, activated, and governed.
Understand the log controls that complement storage and deferred-write choices.
See how declared temporary data connects to work file capacity.