Skip to content

Commit

Permalink
Document pool_count
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 7, 2024
1 parent e75c32a commit 52c0aa0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/ecto/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule Ecto.Repo do
to the adapter. For this particular example, you can check
[`Ecto.Adapters.Postgres`](https://hexdocs.pm/ecto_sql/Ecto.Adapters.Postgres.html)
for more information. In spite of this, the following configuration values
are shared across all adapters:
are common across all adapters:
* `:name`- The name of the Repo supervisor process
Expand All @@ -46,6 +46,14 @@ defmodule Ecto.Repo do
* `:pool_size` - the size of the pool used by the connection module.
Defaults to `10`
* `:pool_count` - the number of pools to run concurrently,
increase this option when the pool itself may be under contention.
When running multiple pools, queries are randomly routed to different
pools, without taking into account how many connections are available
in each. So in some circumstances, you may be routed to a fully busy
pool while others have connections available. The overall number of
connections used will be `pool_size * pool_count`. Defaults to `1`
* `:telemetry_prefix` - we recommend adapters to publish events
using the [Telemetry](`:telemetry`) library. By default, the telemetry prefix
is based on the module name, so if your module is called
Expand Down Expand Up @@ -1591,7 +1599,8 @@ defmodule Ecto.Repo do
@doc group: "Schema API"
@callback insert_all(
schema_or_source :: binary() | {binary(), module()} | module(),
entries_or_query :: [%{(atom() | String.t()) => value} | Keyword.t(value)] | Ecto.Query.t(),
entries_or_query ::
[%{(atom() | String.t()) => value} | Keyword.t(value)] | Ecto.Query.t(),
opts :: Keyword.t()
) :: {non_neg_integer(), nil | [term()]}
when value: term() | Ecto.Query.t()
Expand Down

0 comments on commit 52c0aa0

Please sign in to comment.