I have found the Cowboy-Elixir-Example and only get about 11.52 [#/sec] under an “Hello World” Benchmark.
I have used for my other projects the Cauldron HTTP/SPDY Server and provided out of the box 4-6k [#/sec] … so do i miss something in this Example or why is cowboy the super fast ErlangHTTP Server so slow?
Even if I can’t confirm the 10 Req/Sec, I do have not much myself…
(Stripping banner and progress from abs output)
$ ab -kc 250 -n 5000 http://localhost:8080/static/static_example.html
[…stripped…]
Server Software:
Server Hostname: localhost
Server Port: 8080
Document Path: /static/static_example.html
Document Length: 1186 bytes
Concurrency Level: 250
Time taken for tests: 100.223 seconds
Complete requests: 5000
Failed requests: 0
Keep-Alive requests: 0
Total transferred: 6855000 bytes
HTML transferred: 5930000 bytes
Requests per second: 49.89 [#/sec] (mean)
Time per request: 5011.144 [ms] (mean)
Time per request: 20.045 [ms] (mean, across all concurrent requests)
Transfer rate: 66.79 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 7
Processing: 5000 5008 9.3 5004 5047
Waiting: 0 6 8.2 3 41
Total: 5001 5008 10.1 5004 5052
Percentage of the requests served within a certain time (ms)
50% 5004
66% 5006
75% 5009
80% 5011
90% 5025
95% 5032
98% 5043
99% 5049
100% 5052 (longest request)
I did some experiments using different levels of concurrency, and I did reach better R/sec values when doing more concurrent requests, but also much higher droprates because I ran out of file handles, something the @Phoenix-Core-Team can tell you more about
Also I tried running on dev and prod environment, which didn’t changed much, RPS were pretty much the same (difference was second digit after the comma).
And phoenix does proof that cowboy can be faster, the following was done using a clean phoenix app as it gets generated by mix phoenix.new:
$ ab -kc 250 -n 5000 http://localhost:4000/
[…stripped…]
Server Software:
Server Hostname: localhost
Server Port: 4000
Document Path: /
Document Length: 1949 bytes
Concurrency Level: 250
Time taken for tests: 1.663 seconds
Complete requests: 5000
Failed requests: 0
Keep-Alive requests: 5000
Total transferred: 11510000 bytes
HTML transferred: 9745000 bytes
Requests per second: 3006.22 [#/sec] (mean)
Time per request: 83.161 [ms] (mean)
Time per request: 0.333 [ms] (mean, across all concurrent requests)
Transfer rate: 6758.13 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 8
Processing: 21 81 18.0 81 124
Waiting: 21 81 18.0 81 124
Total: 21 82 18.5 81 131
Percentage of the requests served within a certain time (ms)
50% 81
66% 88
75% 93
80% 96
90% 107
95% 114
98% 122
99% 126
100% 131 (longest request)
So I do think, that in your example linked above something is configured in a bad way and phoenix does do a better job configuring cowboy I am sure, putting some effort into this issue the linked example can get into the same area of responsiveness.
But I have to admit, I can’t give any numbers for cauldron on my machine right now.