Document Type | Technical Information
Category | Administration
Applicable Product Version | Tibero 7.2.4.
Document Number | TADTI139
Overview
Method
1. sysctl.conf Settings
Kernel Parameter | Value |
|---|---|
| kernel.sem | 10000, 32000, 10000, 10000 |
| kernel.shmall | ceil(shmmax/PAGE_SIZE) |
| kernel.shmmax | Half of physical memory (byte) |
| kernel.shmmni | 4096 |
- kernel.sem
- SEMMSL: Maximum number of semaphores per array
- SEMMNS: Maximum number of semaphores system-wide
- SEMOPM: Maximum number of operations per semaphore call
- SEMMNI: Maximum number of arrays
- kernel.shmall
- Maximum size of shared memory available for the entire system
- kernel.shmmax
- Limits the maximum size of a shared memory segment in Linux
- When starting Tibero, a single segment of TSM size is created. If TOTAL_SHM_SIZE is less than this value, startup will fail.
- kernel.shmmni
- Indicates the maximum number of shared segments
- One segment is created when starting a single Tibero instance
- Setting to 4096 is sufficiently large.
- You can check the number of segments currently in use with the ipcs -m command
NoteIn addition to these parameters, you should refer to the installation guide to set the kernel parameters.
fs.nr_open : Maximum number of files a single process can open
fs.file-max : Maximum number of files supported by any instance on the system
fs.aio-max-nr : Maximum number of asynchronous I/O operations that can be handled by the server on the system
net.ipv4.ip_local_port_range : Range of port numbers that can be automatically assigned when a client connects externally
net.core.rmem_default : Default receive buffer size used when receiving network data net.core.wmem_default : Maximum size to which the receive buffer can grow net.core.rmem_max : Default send buffer size usedspan net.core.wmem_max : Maximum size to which the send buffer can grow
2. Kernel Value Setting Examples
This section checks what restrictions each kernel value sets and provides examples of settings.
2.1 Semaphore Setting and Testing
The kernel.sem parameter is for semaphore-related settings and should be configured considering the semaphore values required by Tibero.
As described in the manual, kernel.sem=10000 32000 10000 10000 set as below
[tibero@tibero ~]$ ipcs -sl ------ Semaphore Limits -------- max number of arrays = 10000 max semaphores per array = 100hores system wide = 32000 max ops per semop call = 10000 semaphore max value = 32767
Checking Semaphore Usage When Starting Tibero
[tibero@tibero path]$ ipcs -su ------ Semaphore Status -------- used arrays = 164 -- SEMMNI allocated semaphores = 328 -โ SEMMNS
Startup Test with Minimum Values
[tibero@tibero path]$ tbdown immediate sudo sysctl -w kernel.sem="10000 328 10000 164" [tibero@tibero path]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode).
Startup Test with SEMMNS Minimum Value -1
[tibero@tibero path]$ tbdown immediate sudo sysctl -w kernel.sem="10000 327 10000 164" [tibero@tibero path]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. semget failed.: No space left on device *************************************************************************** * Cannot get semaphore: * key = 0x8aa81734, errno=28 *************************************************************************** Tibero instance startup failed!
Startup Test with SEMMNI Minimum Value -1
[tibero@tibero path]$ tbdown immediate sudo sysctl -w kernel.sem="10000 328 10000 163" [tibero@tibero path]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. semget failed.: No space left on device *************************************************************************** * Cannot get semaphore: * key = 0x8aa81734, errno=28 *************************************************************************** Tibero instance startup failed!
You can see that startup fails even if it is short by just one.
2.2 kernel.shmmax Shared Segment Maximum Usage Test
Set the shmmax value to the same as TSM, 2147483648.
Edit Configuration File
vi /etc/sysctl.conf
Change shmmax Value
sudo sysctl -w kernel.shmmax="2147483648"
Check Tibero Startup Success
[tibero@tibero ~]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode). Startup successful
Set shmmax Value to One Less
sudo sysctl -w kernel.shmmax="2147483647"
Check Tibero Startup Failure
[tibero@tibero ~] $ tbboot *************************************************************************** * Cannot get shared memory segment: Check TOTAL_SHM_SIZE and OS PARAMETER * SHM_KEY = 0x3f8d32dc, size = 2147483648, SHMMAX = 2147483647 * * Please adjust kernel parameters and retry. * Linux: sysctl kernel.shmmax * sysctl -w kernel.shmmax=2147483648 ***************************************************************************
Since a segment of TSM size is allocated at Tibero startup, startup fails if it is short by even 1 byte.
The shmmax value must be set as TSM โค= shmmax considering the maximum size of the shared segment to be used.
2.3 kernel.shmall Shared Segment Maximum Usage Test
Kernel.shmall is a parameter that sets the total number of shared memory pages that can be allocated on a Linux system.
In other words, kernel.shmall * PAGE_SIZE = the total size of shared memory that can be allocated on the system.
Edit Configuration File
vi /etc/sysctl.conf
Change shmall Value
Change shmall value to 2147483648 (Tibero shared memory size) / 4096 (PAGE_SIZE) sudo sysctl -w kernel.shmall="524288"
Check Tibero Startup Success
[tibero@tibero ~]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode). Startup successful
Set shmall Value to One Less
sudo sysctl -w kernel.shmall="524287"
Check Tibero Startup Failure
[tibero@tibero ~ shmget failed.: No space left on device *************************************************************************** * Cannot get shared memory segment: * SHM_KEY = 0x3f8d32dc, size = 2147483648, errno=28 (No space left on device) *************************************************************************** Startup fails with an error.
Note
Since kernel.shmall is a parameter that sets the total number of shared memory pages that can be allocated on the system, if there is already shared memory in use on the server, you must consider this when setting the value.
Example of kernel.shmall Precautions
### Check currently used shared memory [tibero@tibero ~]$ ipcs -m ---------------- Shared Memory Segments ------------------------ key shmid owner perms bytes nattch status 0x6e948184 49 others 640 1073741824 12 In such cases, for Tibero to start, the value of kernel.shmall must be set to at least (Tibero shared memory size + used shared memory size) / PAGE_SIZE.
2.4 kernel.shmmni Shared Segment Number Limit Test
Check Number of Segments in Usepre data-id="285"[tibero@tibero ~]$ ipcs -m ---------------- Shared Memory Segments ------------------------ key shmid owner perms bytes nattch status 0x6e948184 49 others 640 1073741824 12
Change kernel.shmmni Value to 1 and Start
sudo sysctl -w kernel.shmmni="1" [tibero@tibero ~] $ tbboot shmget failed.: No space left on device *************************************************************************** * Cannot get shared memory segment: * SHM_KEY = 0x3f8d32dc, size = 2147483648, errno=28 (No space left on device) *************************************************************************** Startup fails because one shared segment is already occupied
Change kernel.shmmni Value to 2 and Start
sudo sysctl -w kernel.shmmni="2" [tibero@tibero ~]$ tbboot Change core dump dir to /home/tibero/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (NORMAL mode). Startup successful
Check Number of Segments in Use
[tibero@tibero ~]$ ipcs -m ---------------- Shared Memory Segments ------------------------ key shmid owner perms bytes nattch status 0x6e948184 49 others 640 1073741824 12 0x3f8d32dc 52 tibero 640 2147483648 12
You can see that the kernel.shmmni value must be set considering both the number of segments in use and the number of segments required for Tibero startup.