ipcs -l是各种限制:-lm共享内存、-ls信号量、-lq消息队列。
ipcs -lm命令查看目前系统共享内存的参数限制
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
也可在目录中找到单个的参数文件查看
SHMMAX
含义:单个共享内存段最大字节数,一般为32M
查看:cat /proc/sys/kernel/shmmax
$ cat /proc/sys/kernel/shmmax
sysctl kernel.shmmax
设置:sysctl -w kernel.shmmax =1073741824
SHMMNI
含义:共享内存段最大个数,一般为4096
查看:cat /proc/sys/kernel/shmmni
# cat /proc/sys/kernel/shmmni
设置:
# sysctl -w kernel.shmmni=4096
SHMALL
含义:系统中共享内存页总数默认值:2097152*4096=8GB
查看:cat /proc/sys/kernel/shmall
# cat /proc/sys/kernel/shmall
设置:
# sysctl -w kernel.shmall=2097152