修改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