Skip to content

Commit

Permalink
feat: customize cowboy max_connections and num_acceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
w3b6x9 committed Jul 19, 2022
1 parent db9800d commit d5b5003
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ if config_env() == :prod do
url: [host: "#{app_name}.fly.dev", port: 80],
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
# IMPORTANT: support IPv6 addresses
transport_options: [socket_opts: [:inet6]]
transport_options: [
max_connections: String.to_integer(System.get_env("MAX_CONNECTIONS") || "16384"),
num_acceptors: String.to_integer(System.get_env("NUM_ACCEPTORS") || "100"),
socket_opts: [:inet6] # IMPORTANT: support IPv6 addresses
]
],
check_origin: false,
secret_key_base: secret_key_base
Expand Down

0 comments on commit d5b5003

Please sign in to comment.