Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.2 Estimating the kernel parameters

This section explains how to estimate the values for kernel parameters (Linux operating system parameters).

Before you activate an HADB server, you must set the kernel parameters appropriately. If the kernel parameter values are too small, HADB might not operate correctly. The following table provides guidelines for specifying the kernel parameter values, the files in which to set the kernel parameters, and the applicable parameter names.

Table 6‒2: Guidelines and locations for specifying kernel parameter values

No.

Kernel parameter

Specification guidelines

Settings file and parameter name

1

shmmax

Specifies, in bytes, the maximum size of a shared memory segment. Specify a value that is equal to or greater than the maximum value determined in 6.3.1 Determining the shared memory requirement.

Settings file

/etc/sysctl.conf

Parameter name

kernel.shmmax

2

shmmni

Specifies the maximum number of shared memory segments for the entire system. Specify 2,000 or a larger value.

Settings file

/etc/sysctl.conf

Parameter name

kernel.shmmni

3

shmall

Specifies the maximum number of shared memory pages for the entire system. Specify a value for SHMALL so that the value determined from the following formula is equal to or greater than the value specified for SHMMAX.

Formula

shared memory page size × SHMALL

Settings file

/etc/sysctl.conf

Parameter name

kernel.shmall

4

threads-max

Specifies the maximum number of real threads that HADB can use.

Specify a value that is equal to or greater than the value determined from the following formula:

[Figure]

Settings file

/etc/sysctl.conf

Parameter name

kernel.threads-max

5

aio-max-nr

Specify a value that is equal to or greater than the value determined from the formula in Figure 6‒3: Determining the value of the aio-max-nr kernel parameter. Figure 6‒3: Determining the value of the aio-max-nr kernel parameter appears after this table.

Settings file

/etc/sysctl.conf

Parameter name

fs.aio-max-nr

6

rmem_default

Specifies the default value for the size of the receive buffer. Specify 33,554,432 or a larger value.

Settings file

/etc/sysctl.conf

Parameter name

net.core.rmem_default

7

rmem_max

Specifies the maximum size of the receive buffer. Specify 33,554,432 or a larger value.

Settings file

/etc/sysctl.conf

Parameter name

net.core.rmem_max

8

wmem_default

Specifies the default value for the size of the send buffer. Specify 33,554,432 or a larger value.

Settings file

/etc/sysctl.conf

Parameter name

net.core.wmem_default

9

wmem_max

Specifies the maximum size of the send buffer. Specify 33,554,432 or a larger value.

Settings file

/etc/sysctl.conf

Parameter name

net.core.wmem_max

10

nr_hugepages

When you are applying HugePages to the shared memory, specify the number of pages to be allocated as HugePages. Specify a value that is equal to or greater than the value determined from the following formula:

[Figure]

For details about the amount of shared memory required by the HADB server, see 6.3.1 Determining the shared memory requirement.

You can use the following command to determine the page size per page in HugePages. Pay attention to the unit for the numeric value.

Command to be executed

grep Hugepagesize /proc/meminfo

Execution result example

Hugepagesize: 2048 kB

When the server machine's OS is started, HugePages reserves the number of pages of memory specified in this kernel parameter. If you specify for this kernel parameter a number of pages that exceeds the size of memory installed in the server machine on which the HADB server is installed, the OS cannot be started.

Therefore, for this kernel parameter, you must specify a page number that does not exceed the size of memory installed in the server machine on which the HADB server is installed.

Settings file

/etc/sysctl.conf

Parameter name

vm.nr_hugepages

11

hugetlb_shm_group

When you are starting the HADB server by applying HugePages to the shared memory as a non-superuser, you must add the user's group ID to hugetlb_shm_group of the Linux kernel capability. You use the OS's id command to acquire the user's group ID.

Settings file

/etc/sysctl.conf

Parameter name

vm.hugetlb_shm_group

12

nofile

Specify a value that is equal to or greater than the value determined from the formula in Figure 6‒4: Determining the value of the nofile kernel parameter. Figure 6‒4: Determining the value of the nofile kernel parameter appears after this table.

Settings file#

/etc/security/limits.conf

Parameter name
  • soft nofile

  • hard nofile

13

file-max

Specify a value that is at least the value specified for nofile.

Settings file

/etc/sysctl.conf

Parameter name

fs.file-max

14

memlock

Specify the upper limit of the memory lock for the shared memory.

Specify the memory size provided in the server machine on which the HADB server is installed.

Settings file#

/etc/security/limits.conf

Parameter name
  • soft memlock

  • hard memlock

15

nproc

Specify the upper limit of the number of real threads to be used by HADB.

Specify a value that is equal to or greater than the value determined from the following formula:

[Figure]

Settings file#

/etc/security/limits.conf

The value to be specified in this file must also be specified for the following file:

If the server machine's OS is Red Hat Enterprise Linux Server 6 (64-bit x86_64)

/etc/security/limits.d/90-nproc.conf

If the server machine's OS is Red Hat Enterprise Linux Server 7 (64-bit x86_64)

/etc/security/limits.d/20-nproc.conf

Parameter name
  • soft nproc

  • hard nproc

16

/sys/block/device-name/queue/nr_requests

Sets up the depth of the kernel's I/O queue. Specify 8192.

Change the command-side queue depth queue_depth also. For details about how to set up the queue_depth parameter, see OS- and HBA-related documentation.

Settings file

/sys/block/device-name/queue/nr_requests

17

/sys/block/device-name/queue/scheduler

Sets up the I/O scheduler for each device. Specify deadline.

Settings file

/sys/block/device-name/queue/scheduler

18

/sys/block/device-name/queue/rq_affinity

If the device is a flash drive, specify 2.

Settings file

/sys/block/device-name/queue/rq_affinity

19

/sys/block/device-name/queue/add_random

If the device is a flash drive, specify 0.

Settings file

/sys/block/device-name/queue/add_random

20

/sys/block/device-name/queue/rotational

If the device is a flash drive, specify 0.

Settings file

/sys/block/device-name/queue/rotational

#

If the HADB server is set to be started automatically from Job Management Partner 1/Automatic Job Management System 3, the kernel parameter does not take effect even if it is set to /etc/security/limits.conf. You must use one of the following methods to specify the kernel parameter:

  • Specify the kernel parameter in the environment setting parameters in the job execution environment.

  • Specify the kernel parameter in the automated startup script of Job Management Partner 1/Automatic Job Management System 3.

For details, see Precautions applying when the JP1/AJS3 service starts automatically in Notes on using Unix jobs in the Job Management Partner 1/Automatic Job Management System 3 System Design (Work Tasks) Guide.

Use the following formula to determine the value of the aio-max-nr kernel parameter in Table 6‒2: Guidelines and locations for specifying kernel parameter values.

Figure 6‒3: Determining the value of the aio-max-nr kernel parameter

[Figure]

Use the following formula to determine the value of the nofile kernel parameter in Table 6‒2: Guidelines and locations for specifying kernel parameter values.

Figure 6‒4: Determining the value of the nofile kernel parameter

[Figure]