froy001
I have a phoenix application I deploy using mix release.
This is my mix release file:
import Config
database_url = System.fetch_env!("DATABASE_URL")
pool_size = System.fetch_env!("POOL_SIZE")
application_port = System.fetch_env!("APP_PORT")
secret_key_base = System.get_env("SECRET_KEY_BASE")
live_view_sigining_salt = System.fetch_env!("SIGNING_SALT")
initial_user_password = System.fetch_env!("INITIAL_PASSWORD")
s3_component_bucket = System.fetch_env!("S3_COMPONENT_BUCKET")
dynamo_db_component_upload_table = System.fetch_env!("DYNAMODB_COMPONENT_UPLOAD_TABLE")
s3_models_bucket = System.fetch_env!("S3_MODELS_BUCKET")
aws_access_key_id = System.fetch_env!("AWS_ACCESS_KEY_ID")
aws_secret_access_key = System.fetch_env!("AWS_SECRET_ACCESS_KEY")
config :cybord, Cybord.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(pool_size)
config :cybord, CybordWeb.Endpoint,
http: [
:inet6,
port: String.to_integer(application_port),
transport_options: [socket_opts: [:inet6]],
protocol_options: [idle_timeout: :infinity]
],
# This is critical for ensuring web-sockets properly authorize.
url: [host: "localhost"],
render_errors: [view: CybordWeb.ErrorView, accepts: ~w(json), layout: false],
pubsub_server: Cybord.PubSub,
live_view: [signing_salt: live_view_sigining_salt],
secret_key_base: secret_key_base
config :cybord,
cool_text: System.fetch_env!("COOL_TEXT"),
initial_password: initial_user_password,
component_images_storage_bucket: s3_component_bucket,
dynamo_db_component_table: dynamo_db_component_upload_table,
models_storage_bucket: s3_models_bucket
As you can see idle_timeout: :infinity. But I get a timeout on my production server (deployed on AWS ECS)
The timeout happens after 60 sec which is the cowboy default idle timeout.
This makes me think that for some reason the EndPoint is read from my prod.exs where there is no mentioning of timeout.
prod.exs
config :cybord, CybordWeb.Endpoint, server: true
config :cybord, open_api_path: "priv/static/swagger.json"
config :ex_aws,
json_codec: Jason,
access_key_id: {:system, "AWS_ACCESS_KEY_ID"},
secret_access_key: {:system, "AWS_SECRET_ACCESS_KEY"},
region: "us-east-2"
What is the precedence order of config files in release?
Anybody has a better idea on why this is happening?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
There’s heavy doomer energy on many of the forum threads.
This community has traditionally been optimistic and forward thinking. Now th...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
shanesveller
You should also verify that this isn’t from the load-balancing layer on AWS because each of those have idle timeouts as well. It’s typically in the strict sense of “no bytes have flowed in or out in this time” though.
shanesveller
In terms of precedence, I typically tell people to use a remote console (or whatever the non-Distillery name for the release’s subcommand is) and check
Application.get_all_env/1to see if their desired configuration is being realized on the running release. If not, work backwards from there.Elixir 1.11 will bring a unifying idea of runtime config that behaves the same in dev/test/prod/releases and should make this question of precedence slightly less ambiguous/hard to teach.
LostKobrakai
Precedence is quite simple actually:
config.exsis evalutated by mix, so for releases at the time the release is built. Everythingimport_configfollows the order of execution.releases.exsis evaluated when a release is started.Exadra37
I have a clear defined precedence in my setup, because my
releases.exsfile is always evaluated first, no matter what env I am working on, therefore I override production config in development, not the other way around. See my reply with an example here:config.exs
LostKobrakai
So at build time you’re evaluating
releases.exsjust to override it withprod.exs, which at release startup is then overriden byreleases.exscontents. This to me sounds like way backwards.froy001
Thanks for this. It was a good tip.
froy001
I am going to use this pattern. It is great.
Exadra37
The example is a very simplified one.
In
releases.exsI will put all the config that is for a production environment, and then in each environment test and development environment I override only what I need.From the example comments:
LostKobrakai
I saw that the last time you posted it, but I still feel this is problematic. To me it works like that:
config.exs(baseline)→
#{Mix.exs}(Mix level override)—>
releases.exs(system/runtime level override)Config is by no means separate. The stuff from
config.exsandprod.exsis fully available to your release. What you did by no means solved the problem because someone adding a config indev.exswill still make it be not configured in a prod release.froy001
What if I have both prod.exs, config.exs(obviously importing prod.exs) and release.exs. Both prod and release configure the same env attribute. Will release triumph? and have its data used?