Browse Source

Update Elixir to 1.5.2, Phoenix to 1.3 and few optimisations (#2988)

ardhitama 7 years ago
parent
commit
e1336b7139

+ 1 - 1
frameworks/Elixir/cowboy/lib/hello.ex

@@ -7,7 +7,7 @@ defmodule Hello do
     {:ok, _} = :cowboy.start_http(:http,
     {:ok, _} = :cowboy.start_http(:http,
                                   5000,
                                   5000,
                                   [port: 8080],
                                   [port: 8080],
-                                  [env: [dispatch: dispatch], max_keepalive: 5_000_000])
+                                  [env: [dispatch: dispatch], max_keepalive: :infinity])
   end
   end
 end
 end
 
 

+ 1 - 1
frameworks/Elixir/cowboy/mix.exs

@@ -4,7 +4,7 @@ defmodule Hello.Mixfile do
   def project do
   def project do
     [app: :hello,
     [app: :hello,
      version: "0.1.0",
      version: "0.1.0",
-     elixir: "~> 1.4",
+     elixir: "~> 1.5",
      deps: deps()]
      deps: deps()]
   end
   end
 
 

+ 1 - 1
frameworks/Elixir/cowboy/setup.sh

@@ -10,4 +10,4 @@ mix local.rebar --force
 mix deps.get --force --only prod
 mix deps.get --force --only prod
 mix compile --force
 mix compile --force
 
 
-elixir --detached --no-halt -S mix
+elixir --erl "+K true +sbwt very_long +swt very_low" --detached --no-halt -S mix

+ 5 - 2
frameworks/Elixir/phoenix/config/prod.exs

@@ -2,8 +2,11 @@ use Mix.Config
 
 
 config :hello, Hello.Endpoint,
 config :hello, Hello.Endpoint,
   url: [host: "0.0.0.0"],
   url: [host: "0.0.0.0"],
-  http: [port: 8080, protocol_options: [max_keepalive: 5_000_000]],
+  http: [port: 8080, protocol_options: [max_keepalive: :infinity], backlog: 8096],
   cache_static_lookup: false,
   cache_static_lookup: false,
+  check_origin: false,
+  debug_errors: false,
+  code_reloader: false,
   server: true
   server: true
 
 
 config :hello, Hello.Repo,
 config :hello, Hello.Repo,
@@ -12,7 +15,7 @@ config :hello, Hello.Repo,
   password: "benchmarkdbpass",
   password: "benchmarkdbpass",
   database: "hello_world",
   database: "hello_world",
   hostname: "127.0.0.1",
   hostname: "127.0.0.1",
-  pool_size: 20
+  pool_size: 256
 
 
 # ## SSL Support
 # ## SSL Support
 #
 #

+ 5 - 5
frameworks/Elixir/phoenix/mix.exs

@@ -4,7 +4,7 @@ defmodule Hello.Mixfile do
   def project do
   def project do
    [app: :hello,
    [app: :hello,
     version: "0.1.0",
     version: "0.1.0",
-    elixir: "~> 1.4",
+    elixir: "~> 1.5",
     elixirc_paths: elixirc_paths(Mix.env),
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix] ++ Mix.compilers,
     compilers: [:phoenix] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
     build_embedded: Mix.env == :prod,
@@ -26,11 +26,11 @@ defmodule Hello.Mixfile do
   #
   #
   # Type `mix help deps` for examples and options
   # Type `mix help deps` for examples and options
   defp deps do
   defp deps do
-    [{:phoenix, "~> 1.2.1"},
-     {:phoenix_ecto, "~> 3.0"},
+    [{:phoenix, "~> 1.3"},
+     {:phoenix_ecto, "~> 3.3"},
      {:postgrex, ">= 0.0.0"},
      {:postgrex, ">= 0.0.0"},
      {:cowboy, "~> 1.0"},
      {:cowboy, "~> 1.0"},
-     {:phoenix_html, "~> 2.6"},
-     {:phoenix_live_reload, "~> 1.0", only: :dev}]
+     {:phoenix_html, "~> 2.10"},
+     {:phoenix_live_reload, "~> 1.1", only: :dev}]
   end
   end
 end
 end

+ 1 - 1
frameworks/Elixir/phoenix/setup.sh

@@ -12,4 +12,4 @@ mix local.rebar --force
 mix deps.get --force --only prod
 mix deps.get --force --only prod
 mix compile --force
 mix compile --force
 
 
-elixir --detached -S mix phoenix.server
+elixir --erl "+K true +sbwt very_long +swt very_low" --detached -S mix phoenix.server

+ 3 - 3
toolset/setup/linux/languages/elixir.sh

@@ -5,11 +5,11 @@ fw_depends erlang
 fw_installed elixir && return 0
 fw_installed elixir && return 0
 
 
 ELIXIR_HOME=$IROOT/elixir
 ELIXIR_HOME=$IROOT/elixir
-VERSION="1.4.1-1"
+VERSION="1.5.2-1"
 RELEASE="trusty"
 RELEASE="trusty"
-ARCH="all"
+ARCH="amd64"
 
 
-fw_get -O http://packages.erlang-solutions.com/debian/pool/elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb
+fw_get -O http://packages.erlang-solutions.com/erlang/elixir/FLAVOUR_2_download/elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb
 dpkg -x elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb $IROOT/elixir
 dpkg -x elixir_${VERSION}~ubuntu~${RELEASE}_${ARCH}.deb $IROOT/elixir
 $IROOT/erlang/usr/lib/erlang/Install -minimal $IROOT/erlang/usr/lib/erlang
 $IROOT/erlang/usr/lib/erlang/Install -minimal $IROOT/erlang/usr/lib/erlang