Hi!,
I am having a lot of trouble setting up phoenix app, which uses both TCP and UDP.
This is how the [[services]]
section looks like:
[[services]]
http_checks = []
internal_port = 4000
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 1000
soft_limit = 1000
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[services]]
internal_port = 50000
protocol = "udp"
[[services.ports]]
port = 50000
I allocated dedicated IPv4 address for the app,
I am also successfully binding to the fly-global-services
address:
/ # netstat -ulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 fly-global-services:52896 0.0.0.0:*
udp 0 0 fly-global-services:51393 0.0.0.0:*
udp 0 0 fly-global-services:50000 0.0.0.0:*
However, the UDP is working very unreliably. When launching and deploying new app, it
takes a lot of time for the UDP traffic to be enabled (usually at least 10-20 minutes after launching new app). Until that happens UDP is not forwarded to the container (tcpdump shows nothing).
Once UDP packets start to be forwarded it remains that way throught the following deployments.
The moment UDP starts flowing doesn’t seem to be triggered by any particular event.
I wonder what is the cause of this, whether it is expected that UDP isn’t immediately forwarded after the first port is opened and if the separate [[services]]
entry for UDP is at all needed.
Thanks for any help on this topic!