Meta Description: Learn how to configure CPU, network connections, buffer pools, shared memory, and locks during GBase Database(GBase 8s) initialization. A practical guide to onconfig parameter planning and database performance tuning.

Configuring a database instance is not just about getting it started. The initial parameter settings determine how much CPU capacity, connection concurrency, memory, and locking resources are available to the workload.

In GBase Database(GBase 8s), the onconfig file contains many configuration parameters. However, four parameter groups deserve particular attention during instance initialization:

  1. CPU configuration
  2. Network connections
  3. Memory allocation
  4. Lock management

These groups jointly influence the instance's concurrency and resource capacity. Many changes also require an instance restart before they take effect.

This guide explains how to establish an initial configuration baseline using actual server resources rather than arbitrary default values.

1. Collect Hardware and Workload Information First

Before editing onconfig, collect three essential numbers:

  • Physical CPU cores
  • Total physical memory
  • Expected peak concurrent connections

On Linux, use:

lscpu | grep -E '^CPU\(s\)|Core|Socket|Thread' free -g 

Do not size database parameters using CPU and memory figures alone. Peak concurrency and workload characteristics are equally important.

The objective is to establish a reasonable starting point that can be validated under actual workloads.

2. CPU Configuration: Plan Virtual Processors

Example configuration:

VPCLASS cpu,num=16,noage MULTIPROCESSOR 1 

VPCLASS controls the configuration of CPU virtual processors.

The num value should be planned against available physical CPU capacity and the expected workload. For this example, 16 CPU VPs are configured.

A useful distinction is that logical CPUs and physical cores are not necessarily equivalent. Hyperthreading does not provide the same processing capacity as an additional physical core.

Blindly treating every logical CPU as an independent physical core can lead to excessive CPU VP allocation and increased scheduling overhead.

The noage option controls CPU VP aging behavior.

Configuration principle: Start with physical CPU resources, then validate VP utilization and workload concurrency. Do not assume that increasing the number of VPs always improves performance.

3. Connection Configuration: Plan for Peak Concurrency

Example:

NETTYPE soctcp,10,300,NET 

The parameters describe:

  • soctcp: Network protocol.
  • 10: Number of polling threads.
  • 300: Connections per polling thread.
  • NET: Network VP class.

Ten polling threads can serve as an initial example, but the appropriate value depends on CPU capacity and connection workload.

Connection planning should focus on peak concurrency rather than average connections.

For example, if an application normally maintains 200 connections but can reach 800 during business peaks, sizing the network configuration only for the average creates an avoidable capacity risk.

Also account for connection headroom and the associated session memory requirements.

Configuration principle: Plan connection capacity against peak demand, not the normal operating average.

4. Memory Configuration: Size BUFFERPOOL and Shared Memory Together

Example:

BUFFERPOOL size=16K,buffers=1000000,lrus=32,lru_min_dirty=50,lru_max_dirty=60 SHMVIRTSIZE 2048000 SHMADD 1024000 

The buffer pool is one of the most important memory components in GBase Database(GBase 8s).

Its configured size is determined by:

[
\text{Buffer Pool Size} =
\text{buffers} \times \text{page size}
]

For the example above:

  • Page size: 16KB
  • Number of buffers: 1,000,000
  • Approximate buffer pool size: 16GB

The size value must match the page size of the corresponding database space.

Page-size selection is an initialization decision. It should be considered together with the database storage design rather than treated as a parameter that can be changed casually later.

Understanding the Shared Memory Parameters

Parameter Purpose
BUFFERPOOL Configures database buffer pool memory
SHMVIRTSIZE Sets the initial virtual shared memory segment size
SHMADD Specifies the additional shared memory segment allocation size

The buffer pool is not the only consumer of shared memory.

Session memory, dictionary caches, lock structures, and other internal components also require memory.

Therefore, avoid allocating nearly all physical memory to the buffer pool.

An initial capacity plan should reserve sufficient memory for:

  • Database sessions
  • Sorting and query execution
  • Lock structures
  • Other shared memory consumers
  • Operating system processes

A buffer pool allocation around 50% of physical memory may be a starting reference in some environments, but it is not a universal recommendation. The appropriate allocation depends on workload, connection count, and total memory demand.

Configuration principle: Size the buffer pool and shared memory as one budget, leaving sufficient headroom for other database processes and the operating system.

5. Lock Configuration: Prepare for Concurrent Transactions

Example:

LOCKS 10000000 DEF_TABLE_LOCKMODE row 

The two parameters serve different purposes.

LOCKS defines the number of global lock structures available to the instance.

Write-intensive workloads and high transaction concurrency may require more lock capacity. The initial value should be validated against actual lock consumption and transaction patterns.

DEF_TABLE_LOCKMODE row sets the default table lock mode to row level.

This can reduce unnecessary contention between transactions accessing different rows in the same table.

However, row-level locking also introduces lock-management overhead. It should be evaluated against the application's access patterns and transaction behavior.

Configuration principle: Size lock resources for concurrent transactions, not just the number of database connections.

6. Why the Four Parameter Groups Must Be Tuned Together

CPU, connections, memory, and locks are closely related.

Changing one group can affect resource requirements elsewhere.

For example:

  • Increasing CPU VPs can increase processing concurrency and memory requirements.
  • Increasing connection capacity can increase session memory consumption.
  • More concurrent transactions can increase lock consumption.
  • A larger buffer pool reduces the memory available for other shared memory consumers if total memory remains unchanged.

This is why GBase Database initialization should be treated as a coordinated capacity planning exercise.

Configuring each parameter group independently can create an imbalance even when every individual value appears reasonable.

7. Apply the Configuration and Verify the Instance

After reviewing and updating the onconfig file, apply the configuration through an appropriate maintenance window.

For a controlled instance restart, the example commands are:

onmode -ky oninit -vy onstat - 

Once the instance returns to On-Line, verify its operating state.

Do not stop at startup success.

Run connection tests at the expected concurrency and observe:

  • CPU utilization
  • Memory consumption
  • Buffer pool behavior
  • Connection capacity
  • Lock usage and contention
  • Swap activity

The configuration values are a starting point, not the final performance baseline.

Read/write ratios, row width, transaction duration, and application connection behavior all affect the results.

8. Avoid Oversizing: More Resources Do Not Always Mean Better Performance

There is one important warning when configuring GBase Database(GBase 8s): all four parameter groups ultimately compete for finite physical resources.

An oversized buffer pool or excessive lock allocation can leave insufficient memory for sessions and other database operations.

If memory pressure pushes active workloads into swap, the resulting performance may be worse than a more conservative configuration.

Always compare actual memory consumption with the configured values.

A configuration file tells you what you requested. Runtime monitoring tells you what the instance actually needs.

Conclusion: Initialization Is the First Performance Tuning Opportunity

A reliable GBase Database initialization baseline starts with four coordinated decisions:

  • CPU: Configure virtual processors according to physical CPU capacity.
  • Connections: Plan network capacity around peak concurrency.
  • Memory: Balance buffer pool allocation with total shared memory requirements.
  • Locks: Allocate sufficient lock resources for concurrent transactions.

The objective is not to maximize every parameter. It is to balance them against the hardware and workload.

GBase Database provides a flexible configuration framework, but the right initialization parameters must ultimately be validated in your own production environment.