solidDB Help : Programming : Deploying SMA and LLA applications : Deploying SMA applications : Configuring your environment for SMA use : Modifying shared memory kernel parameters: Overview : Modifying shared memory kernel parameters for SMA on Linux
  
Modifying shared memory kernel parameters for SMA on Linux
The default values for shared memory kernel parameters on Linux might not be sufficient for running a Shared Memory Access (SMA) application. To modify the shared memory kernel parameters on Linux, edit the /etc/sysctl.conf file.
You must have root authority to modify kernel parameters.
In Linux environments, you might need to modify the following shared memory parameters:
SHMMNI: Maximum number of shared memory segments on a system
SHMMAX: Maximum size of a single shared memory segment on a system
SHMALL: Maximum allocation of shared memory pages on a system
To update kernel parameters on Red Hat and SUSE Linux to match the shared memory requirements that are set by solidDB, complete the following steps.
Note If you have other processes that run on the same system, you might require higher limit values.
1 Run the ipcs -l command.
The shared memory limits are displayed, for example:
Shared Memory Limits
max number of segments = 4096                 // SHMMNI
max seg size (kbytes) = 32768                 // SHMMAX
max total shared memory (kbytes) = 8388608    // SHMALL
Note Comments have been added to show the parameter names.
2 Analyze the output to determine if there are any necessary changes required for your system, by using the guidance in the following table:
 
Kernel parameter
Description
When to modify
Notes
SHMMNI
Maximum number of shared memory segments on a system
If the value is smaller than the solidDB process size (in MB) divided by 32.
For example, for a process size of 1 GB (1024 MB), at least 32 segments are needed.
Set this parameter to a significantly higher value than required by your database size; a higher value has no side effects.
SHMMAX
Maximum size of a single shared memory segment on a system
If the value is smaller than 32768 KB (32 MB).
Setting this parameter to a higher value has no side effects.
Note The ipcs output has converted SHMMAX kilobytes. The kernel requires the SHMMAX value in bytes.
SHMALL
Maximum allocation of shared memory pages on a system
If one of the following conditions is true:
SharedMemoryAccess.MaxSharedMemorySize=0 and the value of SHMALL is smaller than the maximum size of the physical memory that is in your computer (in KB) divided by 4.
The value of SHMALL is smaller than the value that is set with the parameter SharedMemoryAccess.MaxSharedMemorySize (in KB) divided by 4.
The value that is set with the MaxSharedMemorySize parameter takes precedence over the value that is set with the kernel parameter. Thus, the value that is set with the MaxSharedMemorySize parameter must never be higher than the value that is set with the kernel parameter.
By default, solidDB is set to use the maximum size of the physical memory of the computer (MaxSharedMemorySize=0). Thus, the default value that is set with the kernel parameter might be too low.
Note The ipcs output has converted SHMALL into kilobytes. The kernel requires the SHMALL value as a number of pages.
3 To modify these kernel parameters, edit the /etc/sysctl.conf file.
If the file does not exist, create it. For example, create a file with the following lines:
#Example shmmni for a 1 GB database
kernel.shmmni=400
#Example shmmax for a 64-bit system
kernel.shmmax=1073741824
#Example shmall for 16 GB memory
kernel.shmall=3774873
4 Run sysctl with -p parameter to load in sysctl settings from the default file /etc/sysctl.conf.
sysctl -p
5 Make the changes effective after every reboot.
In SUSE Linux: Make boot.sysctl active.
In Red Hat Linux: The rc.sysinit initialization script reads the /etc/sysctl.conf file automatically.
If you modified the shared memory parameters after getting an out of memory error, you might need to clear hanging, shared memory segments with the ipcrm command. For more details, see Troubleshooting SMA.
Go up to
Modifying shared memory kernel parameters: Overview