修改 /etc/sysctl.conf。
kernel.shmmax=15461882265 kernel.shmall=3774873 kernel.msgmax=65535 kernel.msgmnb=65535 执行 sudo sysctl -p
可以使用 ipcs -l 看结果。ipcs -u 可以看到实际使用的情况。
------ Shared Memory Limits -------- max number of segments = 4096 max seg size (kbytes) = 15099494 max total shared memory (kbytes) = 15097856 min seg size (bytes) = 1 ------ Semaphore Limits -------- max number of arrays = 128 max semaphores per array = 250 max semaphores system wide = 32000 max ops per semop call = 32 semaphore max value = 32767 ------ Messages: Limits -------- max queues system wide = 16 max size of message (bytes) = 8192 DEFAULT max size of queue (bytes) = 16384