
AnonHugePages: 57344 kB
HugePages_Total: 200
HugePages_Free: 200
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
cat /proc/sys/vm/nr_hugepages
200
tail /etc/sysctl.conf
vm.nr_hugepages = 200
之后sysctl -p
pg配置文件
shared_buffers = 400MB
huge_pages =on
最后启动pg报错
2024-12-20 15:31:38.855 CST [4572] FATAL: could not map anonymous shared memory: Cannot allocate memory
2024-12-20 15:31:38.855 CST [4572] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 452878336 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connection
请问这个该如何修改?
$ free -g
total used free shared buff/cache available
Mem: 3 0 2 0 0 1
Swap: 11 0 11
CentOS Linux release 7.9 pg --12.6