I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
#!/bin/bash | |
# This script can be used in "run & hope" mode or you can use it as a recipe to | |
# do things manually - you probably want the latter if you really care about | |
# the data in your databases. | |
# Happy hacking | |
# /Eoin/ | |
# Tell bash to stop if something goes wrong | |
set -e |
broadcast! socket, "insert_img", %{ | |
url: url, | |
start: params["start"], | |
end: params["end"] | |
} | |
defmodule MyApp.Web do | |
def controller do | |
quote do | |
use Phoenix.Controller | |
use MyApp.CatchAllController | |
... | |
end | |
end | |
end |
A new socket behaviour has been introduced to handle socket authentication in a single place, wire up default channel assigns, and disconnect a user's multiplex connection as needed.
First things first, create a UserSocket
module in web/channels/user_socket.ex
and move all your channel routes from web/route.ex
to the user socket: (replace MyApp with your application module)
0.14.x - web/router.ex:
defmodule MyApp.Router do
...
defmodule MyApp.Password do | |
@moduledoc """ | |
Handles password authentication, encryption, and decryption | |
""" | |
@doc """ | |
Encrypte the password String | |
""" | |
def encrypt(raw_password) do |