修改postgresql max_connections

postgresql的默认最大连接数是200, 如果连接数超过200就会报 So many clients alreay. 当然你可以通过show max_connections;查看当前最大的连接数

 

修改最大连接数, 最重要的就是要修改shmmax(Maximum size of shared memory segment (bytes))

http://www.postgresql.org/docs/current/static/kernel-resources.html#SYSVIPC-PARAMETERS
这里有讲解

这里讲解都什么占用shm,(shared memory segment)
http://www.postgresql.org/docs/current/static/kernel-resources.html#SYSVIPC

这里有server start failed的信息描述
http://www.postgresql.org/docs/current/static/server-start.html#SERVER-START-FAILURES


在linux(CentOS)下修改shm可以用sysctl
1> sysctl -a 列出所有
sysctl -a | grep shmmax
2> sysctl -w 修改
sysctl -w kernel.shmmax=500000000(注意等号前后不能有空格)

posted @ 2012-03-27 09:47  john2000  阅读(5200)  评论(0编辑  收藏  举报