Split Clickhouse pools into Read-Only and Read/Write (dedicated to writes) (#2661)
* Configure ingest repo access/pool size If I'm not mistaken 3 is a sane default, the only inserts we're doing are: - session buffer dump - events buffer dump - GA import dump And all are serializable within their scopes? * Add IngestRepo * Start IngestRepo * Use IngestRepo for inserts * Annotate ClickhouseRepo as read_only So no insert* functions are expanded * Update moduledoc * rename alias * Fix default env var value so it can be casted * Use IngestRepo for migrations * Set default ingest pool size from 3 to 5 in case conns are restarting or else... * Ensure all Repo prometheus metrics are collectedpull/2667/head r2023.02.12-54
parent
4494252cce
commit
8f85b110aa
@ -0,0 +1,17 @@
|
||||
defmodule Plausible.IngestRepo do
|
||||
@moduledoc """
|
||||
Write-centric Clickhouse access interface
|
||||
"""
|
||||
|
||||
use Ecto.Repo,
|
||||
otp_app: :plausible,
|
||||
adapter: ClickhouseEcto
|
||||
|
||||
defmacro __using__(_) do
|
||||
quote do
|
||||
alias Plausible.IngestRepo
|
||||
import Ecto
|
||||
import Ecto.Query, only: [from: 1, from: 2]
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue