LoginSignup
6
5

More than 5 years have passed since last update.

phoenixのアプリケーションでSO_REUSEPORTを使えるか調べた

Last updated at Posted at 2017-04-07

docker containerを使ったAPI系のサーバのdeployをする際にSO_REUSEPORTが使えるか調べた。

結論

しんどそう。(できないとは言ってない)

  • http(s)に限って言えばできないことはなさそう
  • そもそもcontainerの話なんだけど、epmdとかそういうのケアしなくっていいんだっけ問題もありそう。

メモ

config :my_app, MyApp.Endpoint, [
  http: [
    {:port, 4000},
    {:raw, 1, 15, <<1, 0, 0, 0>>}
  ]
]
--- [binary, {active, false}, {packet, raw}, {reuseaddr, true}])).
+++ [binary, {active, false}, {packet, raw}, {reuseaddr, true}, {:raw, 1, 15, <<1, 0, 0, 0>>}])).
  • これで同じportを使ってphoenixを多重起動してもeaddrinuseで怒られることはなかった。
6
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5