修改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(注意等号前后不能有空格)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM