decreasing default max_connections option

This commit is contained in:
Alexander Strizhakov 2020-04-29 16:34:05 +03:00
parent a563203618
commit 3d0c943e55
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
4 changed files with 5 additions and 5 deletions

View file

@ -606,7 +606,7 @@ config :pleroma, Pleroma.Repo,
prepare: :unnamed
config :pleroma, :connections_pool,
max_connections: 250,
max_connections: 125,
max_idle_time: 1,
closing_idle_conns_interval: 1,
retry: 1,

View file

@ -2932,7 +2932,7 @@ config :pleroma, :config_description, [
%{
key: :max_connections,
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]
},
%{

View file

@ -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.
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.
* `: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.

View file

@ -51,7 +51,7 @@ defmodule Pleroma.Gun.Conn do
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
:ok = Gun.set_owner(conn_pid, Process.whereis(name))