PostgreSQL 的默认连接池限制是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38532303/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the default connection pool limit for PostgreSQL?
提问by user2670818
I am using Mac OS and recently installed PostgreSQL using brew command.
我正在使用 Mac OS,最近使用 brew 命令安装了 PostgreSQL。
Do you have any idea where in the configuration can I find the default connection pool limit?
您知道我可以在配置中的何处找到默认连接池限制吗?
I am providing read/write performance testing and I want to reassure that the database is not restricted by default.
我正在提供读/写性能测试,我想确保数据库在默认情况下不受限制。
Also, where can I access the configuration for setting up for example 100 connections.
另外,我在哪里可以访问用于设置例如 100 个连接的配置。
Thanks!
谢谢!
回答by jmelesky
Just to clarify up front: postgresql does not have any built-in connection pooling. When you connect, the server forks a new process, when you disconnect, that process ends.
只是为了澄清:postgresql 没有任何内置的连接池。当您连接时,服务器派生一个新进程,当您断开连接时,该进程结束。
That said, brew tends to install things into a tree under /usr/local
. For me, the database was created in /usr/local/var/postgres
.
也就是说, brew 倾向于将东西安装到/usr/local
. 对我来说,数据库是在/usr/local/var/postgres
.
There are a few config files, but the important ones are postgresql.conf
(most of the server configuration), and pg_hba.conf
(where you define which hosts and users can connect to which databases).
有一些配置文件,但重要的是postgresql.conf
(大部分服务器配置)和pg_hba.conf
(您定义哪些主机和用户可以连接到哪些数据库)。
In postgresql.conf
, there is a configuration option, max_connections
. That's most likely the configuration option you're looking for.
在 中postgresql.conf
,有一个配置选项,max_connections
。这很可能是您正在寻找的配置选项。