1.合適的最大連接數
used_connections/max_connections在85%左右
2.修改最大連接數
postgresql最大連接數默認為100
1)打開postgresql配置文件
vim /var/lib/pgsql/9.4/data/postgresql.conf
2)修改最大連接數
max_connections = 100
3)重啟postgresql服務
在CentOS 6.x系統中
service postgresql-9.4 restart
在CentOS 7系統中
systemctl restart postgresql-9.4