[英]Slick 3.0 with default connection pooling and postgresql 9.4.4 is throughing “too many clients already” error
Currently I am building an application with micro services. 目前我正在构建一个微服务应用程序。 I have three instances which are actually interacting with the database ie Postgresql 9.4.4.
我有三个实际与数据库交互的实例,即Postgresql 9.4.4。
Below is my connection properties with slick 3.0 下面是我与slick 3.0的连接属性
dev {
# Development Database configuration
# ~~~~~
dbconf {
dataSourceClass="org.postgresql.ds.PGSimpleDataSource"
properties {
user="xyz"
password="dev@xyz"
databaseName="dev_xyz"
serverName="localhost"
}
numThreads=10
}
}
The problem is that I am getting this FATAL: sorry, too many clients already error. 问题是我收到了这个致命错误:对不起,太多的客户已经出错了。 max_connections in postgresql is 100 which is the default.
postgresql中的max_connections是100,这是默认值。 As per the discussions in the web I might have to use a connection pool for this, which is I am doing by using Slick's default connection pool HikariCP.
根据网络上的讨论,我可能必须使用连接池,这是我使用Slick的默认连接池HikariCP。 I am damn confuse right now, what step should I take to resolved this issue.
我现在很困惑,我应该采取什么措施来解决这个问题。
Add the maxConnections
parameter to your configuration. 将
maxConnections
参数添加到配置中。
dbconf {
numThreads=10
maxConnections=10
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.