RoyalMist
How to change request timeout of Phoenix Endpoint with Bandit
Hello ![]()
I got a stupid question I cannot find a way to increase the default timeout of 60_000 microseconds.
A client of mine is currently uploading zips to my app and the size is currently too big for this default timeout.
After lokking at Bandit docs I put it like this:
config :bazzile, BazzileWeb.Endpoint,
secret_key_base: secret_key_base,
url: [host: host, scheme: "https", port: 443],
check_origin: false,
http: [
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: port,
options: [
read_timeout: 300_000
]
]
But it is not working. Any clue on this ?
Thanks a lot ![]()
Most Liked
mtrudel
Sorry for the late reply!
The option to set body read timeouts is actually set as part of the Plug.Conn.read_body/2 call; see Plug.Conn — Plug v1.20.2 (specifically the read_timeout parameter) for details.
The read_timeout parameter as you’re passing it above (note that the options field has recently changed to thousand_island_options) is concerned with read timeouts for operations not otherwise set via the Plug.Conn API, such as header reading, HTTP/2 frame reading, etc.
PJUllrich
I just configured it like this:
config :my_app, MyAppWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
http: [
ip: {0, 0, 0, 0, 0, 0, 0, 0},
port: port,
thousand_island_options: [
# Wait 60s for the client to complete the connection/upload before forcibly shutting it (Default: 15s)
shutdown_timeout: 60_000
]
],
secret_key_base: secret_key_base
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









