fix pool sizes
All checks were successful
Build and Publish / build-release (push) Successful in 2m38s

This commit is contained in:
2026-04-14 16:05:41 -05:00
parent f06eeb13c8
commit f0e592a220
4 changed files with 22 additions and 8 deletions

View File

@@ -1,7 +1,6 @@
import Config import Config
# Do not print debug messages in production config :logger, level: :debug
config :logger, level: :info
# Runtime production configuration, including reading # Runtime production configuration, including reading
# of environment variables, is done on config/runtime.exs. # of environment variables, is done on config/runtime.exs.

View File

@@ -7,6 +7,20 @@ import Config
# any compile-time configuration in here, as it won't be applied. # any compile-time configuration in here, as it won't be applied.
# The block below contains prod specific runtime configuration. # The block below contains prod specific runtime configuration.
logger_level =
case System.get_env("LOG_LEVEL", "info") do
"debug" -> :debug
"info" -> :info
"warn" -> :warning
"error" -> :error
val when val in ["warning", "error"] -> :error
_ -> :info
end
config :logger, level: logger_level
config :logger, :console, format: {Logger.Formatter, :format}
# ## Using releases # ## Using releases
# #
# If you use `mix release`, you need to explicitly enable the server # If you use `mix release`, you need to explicitly enable the server
@@ -39,13 +53,13 @@ if config_env() == :prod do
config :policy_service, PolicyService.Repo, config :policy_service, PolicyService.Repo,
url: database_url, url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), pool_size: 1,
socket_options: maybe_ipv6 socket_options: maybe_ipv6
config :policy_service, PolicyService.EventStore, config :policy_service, PolicyService.EventStore,
serializer: Commanded.Serialization.JsonSerializer, serializer: Commanded.Serialization.JsonSerializer,
url: database_url, url: database_url,
pool_size: 5 pool_size: 1
secret_key_base = secret_key_base =
System.get_env("SECRET_KEY_BASE") || System.get_env("SECRET_KEY_BASE") ||

View File

@@ -29,13 +29,13 @@
meta = { meta = {
mainProgram = "policy_service"; mainProgram = "policy_service";
}; };
removeCookie = false;
}; };
dockerImage = pkgs.dockerTools.buildLayeredImage { dockerImage = pkgs.dockerTools.buildLayeredImage {
name = "policy_service"; name = "policy_service";
contents = [ package pkgs.busybox pkgs.shadow ]; contents = [ package pkgs.bashInteractive pkgs.busybox pkgs.shadow ];
config = { config = {
Cmd = [ "${package}/bin/policy_service" "start" ]; Cmd = [ "${package}/bin/policy_service" "start" ];
Entrypoint = [ "/bin/sh" ];
}; };
}; };
in in

View File

@@ -25,6 +25,7 @@ controllers:
repository: gitea.corredorconect.com/software-engineering/policy-service repository: gitea.corredorconect.com/software-engineering/policy-service
tag: '{{ $.Chart.AppVersion }}' tag: '{{ $.Chart.AppVersion }}'
env: env:
LOG_LEVEL: debug
MIX_ENV: prod MIX_ENV: prod
PORT: "8080" PORT: "8080"
PHX_HOST: "0.0.0.0" PHX_HOST: "0.0.0.0"
@@ -65,10 +66,10 @@ controllers:
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
memory: 512Mi memory: 256Mi
limits: limits:
cpu: 500m cpu: 500m
memory: 1Gi memory: 512Mi
service: service:
main: main: