decreasing default max_connections option
This commit is contained in:
parent
a563203618
commit
3d0c943e55
@ -606,7 +606,7 @@ config :pleroma, Pleroma.Repo,
|
|||||||
prepare: :unnamed
|
prepare: :unnamed
|
||||||
|
|
||||||
config :pleroma, :connections_pool,
|
config :pleroma, :connections_pool,
|
||||||
max_connections: 250,
|
max_connections: 125,
|
||||||
max_idle_time: 1,
|
max_idle_time: 1,
|
||||||
closing_idle_conns_interval: 1,
|
closing_idle_conns_interval: 1,
|
||||||
retry: 1,
|
retry: 1,
|
||||||
|
@ -2932,7 +2932,7 @@ config :pleroma, :config_description, [
|
|||||||
%{
|
%{
|
||||||
key: :max_connections,
|
key: :max_connections,
|
||||||
type: :integer,
|
type: :integer,
|
||||||
description: "Maximum number of connections in the pool. Default: 250 connections.",
|
description: "Maximum number of connections in the pool. Default: 125 connections.",
|
||||||
suggestions: [250]
|
suggestions: [250]
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
|
@ -394,9 +394,9 @@ For each pool, the options are:
|
|||||||
|
|
||||||
Advanced settings for connections pool. Pool with opened connections. These connections can be reused in worker pools.
|
Advanced settings for connections pool. Pool with opened connections. These connections can be reused in worker pools.
|
||||||
|
|
||||||
For big instances it's recommended to increase `max_connections` up to 500-1000. It will increase memory usage, but federation would work faster.
|
For big instances it's recommended to increase `max_connections` up to 250-500. It will increase memory usage, but federation would work faster.
|
||||||
|
|
||||||
* `:max_connections` - maximum number of connections in the pool. Default: 250 connections.
|
* `:max_connections` - maximum number of opened connections in the pool. Default: 125 connections.
|
||||||
* `:max_idle_time` - maximum of time in minutes, while connection can be idle. Default: 1 minute.
|
* `:max_idle_time` - maximum of time in minutes, while connection can be idle. Default: 1 minute.
|
||||||
* `:closing_idle_conns_interval` - interval between cleaning pool in minutes from idle connections. Default: 1 minute.
|
* `:closing_idle_conns_interval` - interval between cleaning pool in minutes from idle connections. Default: 1 minute.
|
||||||
* `:retry` - number of retries, while `gun` will try to reconnect if connection goes down. Default: 1.
|
* `:retry` - number of retries, while `gun` will try to reconnect if connection goes down. Default: 1.
|
||||||
|
@ -51,7 +51,7 @@ defmodule Pleroma.Gun.Conn do
|
|||||||
|
|
||||||
key = "#{uri.scheme}:#{uri.host}:#{uri.port}"
|
key = "#{uri.scheme}:#{uri.host}:#{uri.port}"
|
||||||
|
|
||||||
max_connections = pool_opts[:max_connections] || 250
|
max_connections = pool_opts[:max_connections] || 125
|
||||||
|
|
||||||
with {:ok, conn_pid} <- try_open(name, uri, opts, max_connections) do
|
with {:ok, conn_pid} <- try_open(name, uri, opts, max_connections) do
|
||||||
:ok = Gun.set_owner(conn_pid, Process.whereis(name))
|
:ok = Gun.set_owner(conn_pid, Process.whereis(name))
|
||||||
|
Loading…
Reference in New Issue
Block a user