From 63f3b2c8e355516501c3dae960fcff32c9e2ca78 Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Mon, 19 Nov 2018 22:07:49 +0100 Subject: [PATCH] Fix pool sizes for all apps --- apps/cf_atom_feed/config/config.exs | 3 +++ apps/cf_atom_feed/config/prod.exs | 4 ---- apps/cf_graphql/config/config.exs | 3 +++ apps/cf_jobs/config/config.exs | 3 +++ apps/cf_opengraph/config/config.exs | 28 ++-------------------------- apps/cf_rest_api/config/config.exs | 3 +++ apps/db/config/config.exs | 2 +- 7 files changed, 15 insertions(+), 31 deletions(-) diff --git a/apps/cf_atom_feed/config/config.exs b/apps/cf_atom_feed/config/config.exs index a56f47df..2fd9c169 100644 --- a/apps/cf_atom_feed/config/config.exs +++ b/apps/cf_atom_feed/config/config.exs @@ -19,6 +19,9 @@ config :logger, :console, format: "$time $metadata[$level] $message\n", metadata: [:request_id] +# Configure Postgres pool size +config :db, DB.Repo, pool_size: 1 + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/apps/cf_atom_feed/config/prod.exs b/apps/cf_atom_feed/config/prod.exs index f4a8a87c..3327d009 100644 --- a/apps/cf_atom_feed/config/prod.exs +++ b/apps/cf_atom_feed/config/prod.exs @@ -2,9 +2,5 @@ use Mix.Config config :cf_atom_feed, CF.AtomFeed.Router, cowboy: [port: 80] -config :db, DB.Repo, - adapter: Ecto.Adapters.Postgres, - pool_size: 2 - # Do not print debug messages in production config :logger, level: :info diff --git a/apps/cf_graphql/config/config.exs b/apps/cf_graphql/config/config.exs index ad5b32a3..b254e54c 100644 --- a/apps/cf_graphql/config/config.exs +++ b/apps/cf_graphql/config/config.exs @@ -28,6 +28,9 @@ config :logger, :console, format: "$time $metadata[$level] $message\n", metadata: [:request_id] +# Configure Postgres pool size +config :db, DB.Repo, pool_size: 5 + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/apps/cf_jobs/config/config.exs b/apps/cf_jobs/config/config.exs index f879e9ae..27bfaf46 100644 --- a/apps/cf_jobs/config/config.exs +++ b/apps/cf_jobs/config/config.exs @@ -19,5 +19,8 @@ config :cf_jobs, CF.Jobs.Scheduler, {"*/5 * * * *", {CF.Jobs.Moderation, :update, []}} ] +# Configure Postgres pool size +config :db, DB.Repo, pool_size: 3 + # Import environment specific config import_config "#{Mix.env()}.exs" diff --git a/apps/cf_opengraph/config/config.exs b/apps/cf_opengraph/config/config.exs index 348319a0..1540a07d 100644 --- a/apps/cf_opengraph/config/config.exs +++ b/apps/cf_opengraph/config/config.exs @@ -1,30 +1,6 @@ -# This file is responsible for configuring your application -# and its dependencies with the aid of the Mix.Config module. use Mix.Config -# This configuration is loaded before any dependency and is restricted -# to this project. If another project depends on this project, this -# file won't be loaded nor affect the parent project. For this reason, -# if you want to provide default values for your application for -# 3rd-party users, it should be done in your "mix.exs" file. +# Configure Postgres pool size +config :db, DB.Repo, pool_size: 1 -# You can configure your application as: -# -# config :cf_opengraph, key: :value -# -# and access this configuration in your application as: -# -# Application.get_env(:cf_opengraph, :key) -# -# You can also configure a 3rd-party app: -# -# config :logger, level: :info -# - -# It is also possible to import configuration files, relative to this -# directory. For example, you can emulate configuration per environment -# by uncommenting the line below and defining dev.exs, test.exs and such. -# Configuration from the imported file will override the ones defined -# here (which is why it is important to import them last). -# import_config "#{Mix.env()}.exs" diff --git a/apps/cf_rest_api/config/config.exs b/apps/cf_rest_api/config/config.exs index 35cb9df5..7967704a 100644 --- a/apps/cf_rest_api/config/config.exs +++ b/apps/cf_rest_api/config/config.exs @@ -10,5 +10,8 @@ config :cf_rest_api, CF.RestApi.Endpoint, pubsub: [name: CF.RestApi.PubSub, adapter: Phoenix.PubSub.PG2], server: true +# Configure Postgres pool size +config :db, DB.Repo, pool_size: 10 + # Import environment specific config import_config "#{Mix.env()}.exs" diff --git a/apps/db/config/config.exs b/apps/db/config/config.exs index 1f847627..0879c26d 100644 --- a/apps/db/config/config.exs +++ b/apps/db/config/config.exs @@ -8,7 +8,7 @@ config :db, # Database: use postgres config :db, DB.Repo, adapter: Ecto.Adapters.Postgres, - pool_size: 20 + pool_size: 3 # Import environment specific config import_config "#{Mix.env()}.exs"