Name |
Description |
Reasonable Values |
SHMMAX |
Maximum size of shared memory segment (bytes) |
250kB + 8.2kB * shared_buffers + 14.2kB * max_connections or infinity |
SHMMIN |
Minimum size of shared memory segment (bytes) |
1 |
SHMALL |
Total amount of shared memory available (bytes or pages) |
if bytes, same as SHMMAX; if pages, ceil(SHMMAX/PAGE_SIZE) |
SHMSEG |
Maximum number of shared memory segments per process |
only 1 segment is needed, but the default is much higher |
SHMMNI |
Maximum number of shared memory segments system-wide |
like SHMSEG plus room for other applications |
SEMMNI |
Maximum number of semaphore identifiers (that is, sets) |
>= ceil(max_connections / 16) |
SEMMNS |
Maximum number of semaphores system-wide |
ceil(max_connections / 16) * 17 + room for other applications |
SEMMSL |
Maximum number of semaphores per set |
>= 17 |
SEMMAP |
Number of entries in semaphore map |
see text |
SEMVMX |
Maximum value of semaphore |
>= 255 (The default is often 32767, do not change unless asked to.) |
于是在linux上安装oracle时配置的这三个参数的意义就很清楚了。比如:
kernel.shmall = 2097152 ------可用共享内存的总量,单位页,在32位系统上一页=4k,也就是4096字节。按照这个设置2097152*4k/1024/1024 = 8G, 就是说可用共享内存一共 8G
kernel.shmmax = 2147483648-----单个共享内存段的最大数,2147483648/1024/1024=2048M=2G
kernel.shmmni = 4096 -------单个共享内存段的最小值1096b=4k
kernel.shmmax = 268435456
kernel.shmmni=4096
kernel.shmall=2097152
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
修改/etc/sysctl.conf文件。其中的几个参数的含义是:
kernel.shmmax表示最大共享内存,如果小的话可以按实际情况而定,一般为物理内存的一半,不过我的虚拟机只有256M,所以就全部算进去了。
shmmni表示最小共享内存固定4096KB
shmall表示所有内存大小
sem 4个参数依次是SEMMSL:每个用户拥有信号量最大数,SEMMNS:系统信号量最大数,SEMOPM:每次semopm系统调用操作数,SEMMNI:系统辛苦量集数最大数。这4个参数为固定内容大小。
file-max固定大小65536
ip_local_port_range表示端口的范围,为指定的内容。