服务器32G内存空间
参数优化
$ vi postgresql.conf
shared_buffers = 3072MB
max_connections = 4000
work_mem = 4MB
effective_cache_size = 4GB
maintenance_work_mem = 512MB
wal_buffers = 256
具体优化参数解释参考:https://blog.youkuaiyun.com/zhousenshan/article/details/70233820
启动服务出错
$ pg_ctl -D /data/pg_data start
server starting
$ LOG: could not create IPv6 socket: Address family not supported by protocol
FATAL: could not create semaphores: No space left on device
DETAIL: Failed system call was semget(5432124, 17, 03600).
HINT: This error does *not* mean that you have run out of disk space. It occurs when either the system limit for the maximum number of semaphore sets (SEMMNI), or the system wide maximum number of semaphores (SEMMNS), would be exceeded. You need to raise the respective kernel parameter.