Benches https://github.com/mroth/phoenix-showdown
Erl 17.5 | Elixir 1.1.0-dev
Server:
| class OrderItem < ActiveRecord::Base | |
| belongs_to :product | |
| belongs_to :order | |
| validates :quantity, presence: true, numericality: { only_integer: true, greater_than: 0 } | |
| validate :product_present | |
| validate :order_present | |
| before_save :finalize |
| import {Socket} from "phoenix" | |
| class App { | |
| static init(){ | |
| let socket = new Socket("/ws", { | |
| logger: (kind, msg, data) => { console.log(`${kind}: ${msg}`, data) } | |
| }) | |
| socket.connect() | |
| var current_user_id = parseInt($('user').attr('data-id')) |
| :erlang.system_info(:schedulers_online) |
| defmodule Trophus.Helpers do | |
| alias Trophus.Repo | |
| alias Trophus.User | |
| def current_order(conn) do | |
| current_user_id = conn.private.plug_session["current_user"] | |
| current_user = Repo.get(User, current_user_id) | |
| order_id = get_session(conn, :order_id) | |
| if (order_id != nil) do | |
| Repo.get(Order, order_id) |
| remote: ==> poolboy (compile) | |
| remote: Compiled src/poolboy_sup.erl | |
| remote: Compiled src/poolboy_worker.erl | |
| remote: Compiled src/poolboy.erl | |
| remote: ==> decimal | |
| remote: Compiled lib/decimal.ex | |
| remote: Generated decimal app | |
| remote: ==> poison | |
| remote: Compiled lib/poison.ex | |
| remote: Compiled lib/poison/decoder.ex |
| upstream trophus { | |
| server 127.0.0.1:4000; | |
| } | |
| server{ | |
| listen 80; | |
| server_name trophus.com; | |
| location / { | |
| try_files $uri @proxy; | |
| } |
Benches https://github.com/mroth/phoenix-showdown
Erl 17.5 | Elixir 1.1.0-dev
Server:
| # From MacBookPro: | |
| iex --name two@192.168.1.255 --cookie monster | |
| :global.register_name(:two, :erlang.group_leader) | |
| # From Windows8: | |
| iex --name one@192.168.1.14 --cookie monster | |
| two = :global.register_name :two, :erlang.group_leader | |
| # Then from Windows8, I can run this: |
| ➜ trophus.ex git:(master) ✗ wrk -t30 -c1000 -d300s "https://extrophus.herokuapp.com/" | |
| unable to create thread 17: Too many open files | |
| ➜ trophus.ex git:(master) ✗ wrk -t30 -c1000 -d300s "https://extrophus.herokuapp.com/" | |
| Running 5m test @ https://extrophus.herokuapp.com/ | |
| 30 threads and 1000 connections | |
| Thread Stats Avg Stdev Max +/- Stdev | |
| Latency 1.31s 1.02s 8.59s 90.30% | |
| Req/Sec 8.81 7.38 35.00 72.16% | |
| 59293 requests in 5.00m, 267.95MB read | |
| Socket errors: connect 769, read 0, write 0, timeout 116768 |
| ➜ trophus.ex git:(master) ✗ wrk -t25 -c100 -d300s "https://extrophus.herokuapp.com/explore" | |
| Running 5m test @ https://extrophus.herokuapp.com/explore | |
| 25 threads and 100 connections | |
| Thread Stats Avg Stdev Max +/- Stdev | |
| Latency 7.87s 12.60s 30.30s 75.88% | |
| Req/Sec 6.01 5.16 31.00 58.84% | |
| 47879 requests in 5.01m, 12.09MB read | |
| Socket errors: connect 0, read 100, write 0, timeout 3027 | |
| Non-2xx or 3xx responses: 47879 | |
| Requests/sec: 159.35 |