Nonstop Database, HiRDB Version 9 Installation and Design Guide

[Contents][Index][Back][Next]

15.1.2 Calculation of required memory

The required memory used by a HiRDB single server configuration is the sum of all the terms shown in the following table.

For details about the value specified in the shmmax operating system parameter (for Solaris, shmsys:shminfo_shmmax; for Linux, SHMMAX), see Chapter 20. Specifying OS Parameters.

If you increase the size of shared memory, this might affect transaction performance by increasing the number of page faults. For each operand, specify the most appropriate value based on the guidelines for your particular system.

Table 15-2 Size of memory required for a HiRDB single server configuration

Item Required memory (KB)
Process private area Process private area used by all unit controller processes [Figure] 32-bit mode
E + [Figure]{(64 + 48 [Figure] (u + 1)) [Figure] (value of pd_max_server_process - b - 6) + (64 + {48 [Figure] (y + 1)) [Figure] 3 + w + R} [Figure] 1,024[Figure]
[Figure] 64-bit mode
E + [Figure]{(64 + 64 [Figure] (u + 1)) [Figure] (value of pd_max_server_process - b - 6) + (64 + 64 [Figure] (y + 1)) [Figure] 3 + w} [Figure] 1,024[Figure] + R
[Figure] If you are using plug-ins, add:
+ 1,400
[Figure] If you are using the asynchronous READ facility, add:
+ r
[Figure] If you are using Real Time SAN Replication, add:
+ [Figure]425 [Figure] (2 [Figure] b + 7) [Figure] 1,024[Figure]
[Figure] If fixed was specified in the pd_process_terminator operand, add:
+ F [Figure] (value of pd_process_terminator_max - 1)
[Figure] If you are performing in-memory data processing, add:
+ [Figure]{K [Figure] (value of pd_max_users [Figure] 2 + 7)} [Figure] 1,024[Figure]
[Figure] If you are changing the maximum number of communication traces stored, add:
+ [Figure]M [Figure] 1,024[Figure]
Process private area used by single server process#1 pd_work_buff_mode=each specified [Figure] 32-bit mode
{G + g + (a + 9) [Figure] c + h + i + m + p + q + s} [Figure] (b + 3) + [Figure](64 + 48 [Figure] (v + 1)) [Figure] 1,024[Figure] [Figure] (b + 3) + J
[Figure] 64-bit mode
{G + g + (a + 9) [Figure] c + h + i + m + p + q + s} [Figure] (b + 3) + [Figure](64 + 64 [Figure] (v + 1)) [Figure] 1,024[Figure] [Figure] (b + 3) + J
[Figure] If you are performing in-memory data processing, add:
+ [Figure]{K [Figure] (b + 3)} [Figure] 1,024[Figure]
[Figure] If you are changing the maximum number of communication traces stored, add:
+ [Figure]P [Figure] 1,024[Figure]
pd_work_buff_mode=pool specified or omitted [Figure] 32-bit mode
(G + g + a + [Figure]a [Figure] 128 [Figure] 0.1[Figure] + 11 + h + i + m + n + p + q + s) [Figure] (b + 3) + [Figure](64 + 48 [Figure] (v + 1)) [Figure] 1,024[Figure] [Figure] (b + 3) + J
[Figure] 64-bit mode
(G + g + a + [Figure]a [Figure] 128 [Figure] 0.1[Figure] + 15 + h + i + m + n + p + q + s) [Figure] (b + 3) + [Figure](64 + 64 [Figure] (v + 1)) [Figure] 1,024[Figure] [Figure] (b + 3) + J
[Figure] If you are performing in-memory data processing, add:
+ [Figure]{K [Figure] (b + 3)} [Figure] 1,024[Figure]
[Figure] If you are changing the maximum number of communication traces stored, add:
+ [Figure]P [Figure] 1,024[Figure]
Shared memory Space used by the unit controller in the unit controller shared memory [Figure]d [Figure] 1,024[Figure]
Space used by the single server in the unit controller shared memory E
Global buffer shared memory F
In-memory data processing shared memory L
Utility shared memory T
Security audit information buffer shared memory [Figure] For automatic calculation by the system:
[Figure]0.3 + MAX{(H + 100), (H [Figure] 1.2)} [Figure] 0.25[Figure]
[Figure] For user -specified values (specify the pd_audit_def_buffer_size operand):
Value specified for pd_audit_def_buffer_size
Inter-process memory communication shared memory#2 j [Figure] k

#1: If you are using plug-ins, add 300 per single server process.

#2: Add this value if you have specified PDIPC=MEMORY in the client environment definition. For details about the inter-process memory communication facility and client environment definitions, see the HiRDB Version 9 UAP Development Guide. If either the HiRDB server or the HiRDB client is in 32-bit mode, the system allocates the shared memory for the inter-process memory communication facility in the 32-bit address space.

a: Value of pd_work_buff_size operand

b: Value of pd_max_users operand + value of pd_max_reflect_process_count operand

c: Maximum number of work tables
Obtain the number of work tables for each SQL statement from Table 15-3 Procedure for obtaining the number of work tables for each SQL statement. Use the largest value obtained from Table 15-3 Procedure for obtaining the number of work tables for each SQL statement as the maximum number of work tables.

d: Value obtained from 15.1.3 Formulas for shared memory used by a unit controller.

e: Value obtained from 15.1.4 Formulas for shared memory used by a single server.

f: Value obtained from 15.1.5 Formula for size of shared memory used by global buffers.

g: Size of memory required during SQL execution
For details about the formula, see 15.1.6 Formulas for size of memory required during SQL execution.

h: Size of memory required during SQL preprocessing
For details about the formula, see 15.1.7 Formula for size of memory required during SQL preprocessing.

i: LOB buffer batch input/output work memory
Add 62 KB if a LOB global buffer is specified in the global buffer definition (-b specified in the pdbuffer operand of the system common definition).

j: Maximum number of concurrently executable clients that use the inter-process memory communication facility.
If you are not sure about the value, specify the number of all clients that use the inter-process memory communication facility or the value of the pd_max_users operand.

k: Average memory size for data transfer performed by all clients that use the inter-process memory communication facility (value of PDSENDMEMSIZE + value of PDRECVMEMSIZE in the client environment definition).

m: Memory requirement for Java virtual machine
If you use Java stored procedures or Java stored functions, add the size of memory used by the Java virtual machine. This value depends on the Java virtual machine's options (-Xms, -Xmx, and -Xmn options for Hewlett-Packard JRE 1.2.2.04) and version. For details about the memory requirement for your Java virtual machine, see the applicable manual. Following are the guidelines for the memory required for HP-UX:
  • Eight MB of memory is required to start a Java virtual machine.
  • Add the maximum memory size for the Java virtual machine (value of the -Xmx option). Note that some Java virtual machines may use more memory than the size specified in the -Xmx option.

n: Work table extended memory size
When the pd_work_buff_expand_limit operand is specified, add the work table extended memory size. The work table extended memory size is determined from the following formula:
Work table extended memory size (kilobytes) = work table extended buffer size + [Figure](work table extended buffer size [Figure] 128) [Figure] 0.1[Figure]
  • Work table extended buffer size (kilobytes) = MAX(0, work table extended buffer size based on hash join, subquery hash execution) + MAX(0, work table extended buffer size based on the increase in the number of work tables)
  • Work table extended buffer size based on hash join, subquery hash execution = MIN{ (work table extended buffer size based on hash join, subquery hash execution - value of the pd_work_buff_size operand), (value of the pd_work_buff_expand_limit operand - value of the pd_work_buff_size operand) } [Figure] number of concurrently executing users executing hash join, subquery hash execution
    For details about determining the work table extended buffer size when executing hash join, subquery hash execution, see the HiRDB Version 9 UAP Development Guide.
  • Work table extended buffer size based on the increase in the number of work tables = MIN{ (number of work tables used [Figure] 128 - value of the pd_work_buff_size operand), (value of pd_work_buff_expand_limit operand - value of pd_work_buff_size operand) } [Figure] (number of users such that the number of work tables is greater than the value of the pd_work_buff_size operand [Figure] 128)
    Number of work tables used = MAX(number of work table files used per SQL statement, number of work table files used by the ASSIGN LIST statement)
    For details about determining the number of work table files used per SQL statement and the number of work table files used by the ASSIGN LIST statement, see 18.3 Determining the maximum number of files (pdfmkfs -l command).

p: Memory requirements required for BLOB data type
For details about the formula, see 15.1.8 Formula for size of memory required during BLOB data retrieval or updating (HiRDB single server configuration).

q: Memory requirements required for server-side block transfer or array FETCH
For details about the formula, see 15.1.9 Formula for size of memory required during block transfer or array FETCH.

r: Memory size used by asynchronous READ
This is applicable when the asynchronous READ facility is used; use the following formula (in kilobytes) for the calculation:
(90 +
90
[Figure]Memory used by the RDAREA for management of the HiRDB file system area)
i=1
[Figure] value of pd_max_ard_process
For the memory used by the RDAREA for management of the HiRDB file system area, use 90 areas as the maximum in the calculation. If the number of areas used by the server is fewer than 90, assume that amount anyway.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated from the formula below based on the initial settings:
Note that the parameters at the time of initialization of the area can be checked by running the pdfstatfs command with the -A option specified.
{(Number of files#1 + number of extensions#2) [Figure] 64} [Figure] 1.5#3
#1: Value specified by pdfmkfs -l, or displayed in available file count in the execution results of the pdfstatfs command.
#2: Value specified by pdfmkfs -e, or displayed in available expand count in the execution results of the pdfstatfs command.
#3: Multiply when the area size (value specified in pdfmkfs -n) is at least 2,048.

s: HiRDB file system memory size
Determine with the following formula (in kilobytes):
347 + Memory used by the work tables for management of the HiRDB file system area + Memory used by the system logs for management of the HiRDB file system area +
90
[Figure] Memory used by the RDAREA for management of the HiRDB file system area
i=1
The memory used by the HiRDB file system area for management of work tables and system logs uses the maximum value calculated for the memory used by the HiRDB file system area for management used by the server. For RDAREAs, use 90 areas as the maximum calculation value. If the number of areas used by the server is fewer than 90, assume that amount anyway.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated with the formula below based on the initial settings:
Note that the parameters at the time of initialization of the area can be checked by running the pdfstatfs command with the -A option specified.
{(Number of files#1 + number of extensions#2) [Figure] 64} [Figure] 1.5#3
#1: Value specified by pdfmkfs -l, or displayed in available file count in the execution results of the pdfstatfs command.
#2: Value specified by pdfmkfs -e, or displayed in available expand count in the execution results of the pdfstatfs command.
#3: Multiply when the area size (value specified in pdfmkfs -n) is at least 2,048.

t: When value of pd_utl_exec_mode is 0: 0
When value of pd_utl_exec_mode is 1: [Figure]{(b [Figure] 2,000 + 136) [Figure] 1,024}[Figure] [Figure] 1,024

u: Valid value of pd_module_trace_max for the unit control information definition

v: Valid value of pd_module_trace_max for the single server definition

w: Memory size for restarting HiRDB
If this memory size cannot be allocated, HiRDB restart fails. Use the formula below to determine the size (in bytes):

y: If the operand pd_module_trace_max is specified in the system common definition or the unit control information definition: the value of pd_module_trace_max
If not: 16,383
A + B
  • If commit is specified in the pd_dbsync_point operand, add:
+ 112 [Figure] ((value of pd_max_users + value of pd_max_reflect_process_count) [Figure] 2 + 7)
  • If 1 or a greater value is specified in the pd_inner_replica_control operand, add:
+ C
  • If the number of HiRDB file system areas that store RDAREAs created in a character special file is 1,001 or more, add:
+ D
Use the following variables in the formula to calculate the size of memory used by HiRDB to restart:
Variable Value
A
  • 32-bit mode
246,762 + 4 [Figure] value of pd_max_rdarea_no
+ {48 [Figure] (value of pd_max_rdarea_no + number of tables) + 304} [Figure] ((value of pd_max_users + value of pd_max_reflect_process_count) [Figure] 2 + 7)
  • 64-bit mode
305,274 + 8 [Figure] value of pd_max_rdarea_no
+ {64 [Figure] (value of pd_max_rdarea_no + number of tables) + 512} [Figure] ((value of pd_max_users + value of pd_max_reflect_process_count) [Figure] 2 + 7)
Number of tables: 62 + MAX {value of pd_max_access_tables, 500}
B b1 [Figure] X + b2 [Figure] Y
b1: When the record length of the server status file < 4,096
MAX(([Figure](3,400 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4,096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]),1) [Figure] MAX([Figure]4,096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4,096 [Figure] record length of server status file < 12,288
MAX([Figure](3,400 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure] (record length - 40)
When 12,288 [Figure] record length of server status file
MAX([Figure](3,400 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure] (record length - 40)
X: When the number of RDAREAs [Figure] 3,400: 1
When 3,401 [Figure] number of RDAREAs [Figure] 6,800: 2
When 6,801 [Figure] number of RDAREAs: 3
b2: When the record length of the server status file < 4,096
([Figure](5,662,310 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4,096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]) [Figure] MAX([Figure]4,096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4,096 [Figure] record length of server status file < 12,288
[Figure](5,662,310 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
When 12,288 [Figure] record length of server status file
[Figure](5,662,310 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
Y: When the number of RDAREAs [Figure] 10,200: 0
When 10,201 [Figure] number of RDAREAs [Figure] 5,672,510: 1
When 5,672,511 [Figure] number of RDAREAs [Figure] 11,334,820: 2
When 11,334,821 [Figure] number of RDAREAs: 3
C
  • 32-bit mode
(48 [Figure] value of pd_max_rdarea_no + 80) [Figure] ((value of pd_max_users + value of pd_max_reflect_process_count) [Figure] 2 + 7)
  • 64-bit mode
(64 [Figure] value of pd_max_rdarea_no + 160) [Figure] ((value of pd_max_users + value of pd_max_reflect_process_count) [Figure] 2 + 7)
D
  • 32-bit mode
12,012 [Figure] ([Figure](number of HiRDB file system areas that store RDAREAs created in a character special file - 1,000) [Figure] 1,000[Figure])
  • 64-bit mode
16,016 [Figure] ([Figure](number of HiRDB file system areas that store RDAREAs created in a character special file - 1,000) [Figure] 1,000[Figure])

E, F, G: Fixed value
These values depend on the OS being used. The following table presents the values for each OS (in kilobytes):
OS Value of E Value of F Value of G
HP-UX (32-bit mode) 90,500 2,800 5,600
HP-UX (32-bit-mode POSIX library version) 130,000 2,800 4,900
HP-UX (64-bit mode) 92,100 2,900 6,600
HP-UX (IPF) 211,000 2,600 7,500
AIX (32-bit mode) 75,400 2,100 5,800
AIX (32-bit-mode POSIX library version) 138,200 4,900 8,500
AIX (64-bit mode) 151,900 6,000 12,200
Solaris (32-bit mode) 79,500 1,400 3,600
Solaris (32-bit-mode POSIX library version) 125,100 1,700 3,300
Solaris (64-bit mode) 114,800 2,200 4,500
Linux (32-bit mode) 101,400 3,300 5,200
Linux (EM64T) 154,300 6,700 14,500
Linux 6 (64-bit x86_64) 117,200 1,900 5,800

H: If you are making a rough estimate, this is the number of audit events (the number of executions of CREATE AUDIT). If you are making a detailed estimate, it is the number of entries in the security audit information buffer

J: Memory required when using the facility for acquiring syncpoint output synchronization control information (bytes)
If 1 is specified in the pd_dbbuff_trace_level operand and the pd_dfw_awt_process operand is omitted, add:
32-bit mode
320 [Figure] number of global buffers defined in a single server
64-bit mode
640 [Figure] number of global buffers defined in a single server

K: If 1 or a greater value is specified in the pd_max_resident_rdarea_no operand, add:
1,648 + 16 [Figure] value of pd_max_resident_rdarea_no + 16 [Figure] value of pd_max_resident_rdarea_shm_no

L: Memory required by in-memory data processing
For the applicable formulas, see 15.1.10 Memory required by in-memory data processing.

M: Memory required by communication trace processing
32-bit mode
(16 [Figure] (N - 1,024) [Figure] 2) [Figure] (value of pd_max_server_process - value of pd_max_users - 3)
64-bit mode
(32 [Figure] (N - 1,024) [Figure] 2) [Figure] (value of pd_max_server_process - value of pd_max_users - 3)

N: Value of pd_pth_trace_max enabled as unit control information definition
The value specified for the operand rounded up to a power of two.

P: Memory required by communication trace processing
32-bit mode
(16 [Figure] (Q - 1,024) [Figure] 2) [Figure] (value of pd_max_users + 3)
64-bit mode
(32 [Figure] (Q - 1,024) [Figure] 2) [Figure] (value of pd_max_users + 3)

Q: Value of pd_pth_trace_max enabled as a single server definition
The value specified for the operand rounded up to a power of two.

R: Size of memory for signal handler
HP-UX (IPF) version: 512
Otherwise: 0

Table 15-3 Procedure for obtaining the number of work tables for each SQL statement

SQL statement Procedure for obtaining the number of work tables
SELECT statement
INSERT(-SELECT) statement
When none of 1-8 as follows are applicable: 0
When any of 1-8 as follows are applicable: Sum of the applicable values from 1-8
  1. When multiple tables are joined for retrieval
    Number of additional work tables = (Number of joined tables - 1) [Figure] 2 + 1
  2. When specifying the ORDER BY clause
    Number of additional work tables = 2
  3. When specifying the GROUP BY clause
    Number of additional work tables = Number of GROUP BY clauses specified
  4. When specifying the DISTINCT clause
    Number of additional work tables = Number of DISTINCT clauses specified
  5. When specifying the UNION, UNION ALL, or EXCEPT[ALL] clause
    Number of additional work tables = (Number of UNION or UNION ALL clauses specified) [Figure] 2 + 1
  6. When search condition contains columns with index defined
    Number of additional work tables = Number of columns with index defined in the search condition
  7. When specifying the FOR UPDATE or FOR READ ONLY clause
    Number of additional work tables = 1
  8. When specifying a subquery (quantified predicate)
    Number of additional work tables = Number of subqueries specified
UPDATE statement
DELETE statement
Number of columns with index defined in the search condition + 1
DROP SCHEMA statement
DROP TABLE statement
DROP INDEX statement
CREATE INDEX statement
REVOKE statement to revoke access privilege
2