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) |
|---|
| make_wrq(Method, RawPath, Headers) -> | |
| {ok, Dispatch} = file:consult(filename:join( | |
| [filename:dirname(code:which(?MODULE)), | |
| "..", "priv", "dispatch.conf"])), | |
| R0 = wrq:create(Method, {1,1}, RawPath, mochiweb_headers:from_list(Headers)), | |
| R1 = wrq:set_peer("127.0.0.1", R0), | |
| {_, _, HostTokens, Port, PathTokens, Bindings, AppRoot, StringPath} = | |
| webmachine_dispatcher:dispatch(RawPath, Dispatch, R1), | |
| wrq:load_dispatch_data(Bindings, | |
| HostTokens, |
| curl -d "user_credentials=ACCESS_TOKEN" \ | |
| -d "notification[title]=message title" \ | |
| -d "notification[long_message]=<b>Some text or HTML for the full layout page notification</b>" \ | |
| -d "notification[sound]=bird-1" \ | |
| https://new.boxcar.io/api/notifications |
| <?php | |
| curl_setopt_array( | |
| $chpush = curl_init(), | |
| array( | |
| CURLOPT_URL => "https://new.boxcar.io/api/notifications", | |
| CURLOPT_POSTFIELDS => array( | |
| "user_credentials" => 'ACCESS_TOKEN', | |
| "notification[title]" => 'message title', | |
| "notification[long_message]" => '<b>Some text or HTML for the full layout page notification</b>', |
| !/usr/bin/perl -w | |
| require LWP::UserAgent; | |
| my $ua = LWP::UserAgent->new; | |
| my $boxcarurl = 'https://new.boxcar.io/api/notifications'; | |
| # Put your Boxcar token in this file: | |
| my $accesstoken = `cat ~/.boxcartoken`; | |
| chomp($accesstoken); |
| require 'openssl' | |
| def gen_key(name) | |
| key = OpenSSL::PKey::RSA.new 1048 | |
| file = File.new(name, "w") | |
| file.write(key) | |
| file.close | |
| end | |
| def get_key(name) |
| #!/usr/bin/env python3 | |
| import http.client | |
| import ssl | |
| import urllib.parse | |
| def boxcarpush(): | |
| # Prepare the notification parameters | |
| params = urllib.parse.urlencode({ |
| 1> {ok, Data} = file:script("rebar.config.script"). | |
| ... | |
| 2> file:write_file("rebar.config", io_lib:fwrite("~p.\n", [Data])). | |
| ok |
| Please read original blog post for reference: | |
| http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/ |
| -module(channels). | |
| -compile(export_all). | |
| make() -> | |
| Ref = make_ref(), | |
| Pid = spawn(?MODULE, channel, [Ref]), | |
| {channel, Pid, Ref}. | |
| channel(Ref) -> | |
| receive |
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) |
|---|