我的设置:
postgresql.conf: max_connections = 100
pgbouncer 配置:
[databases]
markets_parser = host=localhost port=5432 dbname=markets_parser user=argon
datestyle=ISO connect_query='SELECT 1'
[pgbouncer]
logfile = /var/log/postgresql/pgbouncer.log
listen_addr = 127.0.0.1
listen_port = 6432
unix_socket_dir = /var/run/postgresql
auth_type = trust
auth_file = /etc/pgbouncer/userlist.txt
admin_users = postgres
stats_users = postgres
pool_mode = session
server_reset_query = DISCARD ALL
max_client_conn = 90
default_pool_size = 70
min_pool_size = 20
reserve_pool_size = 10
我从 django 应用程序(不仅是站点应用程序,还有高负载多线程解析机制)中使用它和一堆 django 管理命令(作为单独的进程运行),它工作正常(虽然,几乎总是,不是当我有活动突然飞溅),当我只运行一个命令时,当我一次运行两个命令时引发很多“连接不足”错误。
该怎么办?