Skip to content

Instantly share code, notes, and snippets.

@arkadijs
Last active September 19, 2015 20:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkadijs/7b00c13ac1eac81cadae to your computer and use it in GitHub Desktop.
Save arkadijs/7b00c13ac1eac81cadae to your computer and use it in GitHub Desktop.
Hackathon: Elixir of truth http://ldn.lv/events/224421036

Elixir hackathon

A 16-core Linux VM in the cloud with 104GB of RAM for running search engines:

ssh-add workshop.pem 
ssh elixir@elixir.hosting.lv

A smaller 8-core, 7GB RAM VM in the same zone for running performance tests:

ssh elixir@elixir-test.hosting.lv

Initial code repository.

ApacheBench has minor issues testing Erlang/Cowboy web servers: 58419, 58417.Thus testing was performed without HTTP keep-alive across all implementations.

Results

SINTER + GET
  • RPS: Go-in-memory 13000 > Scala 800 > Go 410 > Elixir 370
  • CPU: Elixir 1500% > Scala 1100% > Go in memory 900% > Go 600%
SINTER + MGET
  • RPS: Node 2950 > Elixir 2800 = Go 2800 > Scala 2580
  • CPU: Elixir 1100% > Go 800% > Node 580% > Scala 480%
  • RPS/CPU: Scala 5.4 > Node 5.1 > Go 3.5 > Elixir 2.5
  • RSS: Node 1130MB > Scala 690MB > Erlang 150MB > Go 22MB
  • RPS/MEM: Go 127 > Erlang 19 > Scala 3.7 (-Xmx512m) > Node 2.6

Final words

Go-in-memory beats everyone. MGET bottlenecks single-instance Redis. Elixir / Erlang is competitive. Use Node.js for your next microservice ;P

elixir@elixir-test:~$ ab -n 100000 -c 100 -s 1 elixir:4000/content?q=american+anarchism
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking elixir (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software:
Server Hostname: elixir
Server Port: 4000
Document Path: /content?q=american+anarchism
Document Length: 6487 bytes
Concurrency Level: 100
Time taken for tests: 269.111 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 668900000 bytes
HTML transferred: 648700000 bytes
Requests per second: 371.59 [#/sec] (mean)
Time per request: 269.111 [ms] (mean)
Time per request: 2.691 [ms] (mean, across all concurrent requests)
Transfer rate: 2427.33 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 13.8 0 1001
Processing: 116 268 12.3 268 360
Waiting: 116 268 12.3 268 360
Total: 117 269 18.5 269 1313
Percentage of the requests served within a certain time (ms)
50% 269
66% 274
75% 277
80% 279
90% 284
95% 289
98% 295
99% 299
100% 1313 (longest request)
elixir@elixir-test:~$ ab -n 100000 -c 100 -s 1 elixir:8080/content?q=american+anarchism
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking elixir (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: Jetty(9.2.10.v20150310)
Server Hostname: elixir
Server Port: 8080
Document Path: /content?q=american+anarchism
Document Length: 6487 bytes
Concurrency Level: 100
Time taken for tests: 124.454 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 663900000 bytes
HTML transferred: 648700000 bytes
Requests per second: 803.51 [#/sec] (mean)
Time per request: 124.454 [ms] (mean)
Time per request: 1.245 [ms] (mean, across all concurrent requests)
Transfer rate: 5209.47 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 25.8 0 1002
Processing: 2 123 33.7 118 342
Waiting: 2 123 33.7 118 342
Total: 3 124 42.6 118 1179
Percentage of the requests served within a certain time (ms)
50% 118
66% 135
75% 147
80% 153
90% 170
95% 185
98% 202
99% 212
100% 1179 (longest request)
elixir@elixir-test:~$ ab -n 100000 -c 100 -s 1 elixir:4080/content?q=american+anarchism
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking elixir (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: go-search/redis
Server Hostname: elixir
Server Port: 4080
Document Path: /content?q=american+anarchism
Document Length: 6488 bytes
Concurrency Level: 100
Time taken for tests: 240.783 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 661000000 bytes
HTML transferred: 648800000 bytes
Requests per second: 415.31 [#/sec] (mean)
Time per request: 240.783 [ms] (mean)
Time per request: 2.408 [ms] (mean, across all concurrent requests)
Transfer rate: 2680.87 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 6.3 0 1003
Processing: 115 240 6.4 240 272
Waiting: 106 162 5.0 162 192
Total: 116 241 9.0 241 1250
Percentage of the requests served within a certain time (ms)
50% 241
66% 243
75% 245
80% 246
90% 248
95% 250
98% 253
99% 255
100% 1250 (longest request)
elixir@elixir-test:~$ ab -n 100000 -c 100 -s 1 elixir:4088/content?q=american+anarchism
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking elixir (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests
Server Software: go-search/memory
Server Hostname: elixir
Server Port: 4088
Document Path: /content?q=american+anarchism
Document Length: 6488 bytes
Concurrency Level: 100
Time taken for tests: 7.807 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 661100000 bytes
HTML transferred: 648800000 bytes
Requests per second: 12808.32 [#/sec] (mean)
Time per request: 7.807 [ms] (mean)
Time per request: 0.078 [ms] (mean, across all concurrent requests)
Transfer rate: 82691.22 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 6 67.1 1 1009
Processing: 0 2 1.5 1 44
Waiting: 0 1 1.5 1 44
Total: 1 8 67.1 2 1030
Percentage of the requests served within a certain time (ms)
50% 2
66% 3
75% 4
80% 4
90% 5
95% 7
98% 9
99% 12
100% 1030 (longest request)
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAqKPEqyWnr7s2lPXj2srINcAS9aeWF4siFXGixElLpSsTejKE2Ye9Y/ckoZV9
4cxtfGdB85t1TjxxxATFOJV5ZuJpl6tf5eEe40jgvsTWl2Rjv3CKnak5gUitTah7WIiX+aJ/4jsa
G0jh9XNKieMc8JE26ye+oKh1lM8PpOFIglC5WBrcgeBhxnGfGu5bHLEUo0znZDZO0peYhfh/3J0j
IsJd8WVH76nOe/mWc9bKg7bQROOU4aAQOL2gs8YvB4vutuIMLaQ8AHDc1lbGqZUE8xTXbiNBWbr7
6kaFCZ6YdN+EnQkfYJgC+blvgIBqmCUA0qxiLrsg5an/t5bWkh6y2wIDAQABAoIBAFe5EPXiWY8d
OLBWFFfcwjbLmlE1AutuUaWL/hpS8kmR1cjr/JVXedpFVkXDiL7rY0yiPflltaij4p4PyTO89XDi
eAEQgYsIBtQ+NcKmi+Ymr4iHF2QaAjLRRm0uJjOQolWWBSX+jn8A86GFfpGplYVCVKoQe6YA22E0
MLQZCGnYjUugT2xleLGmb8tmhQmV1H+MSPa5fLIN0yRKiEc1beVtdfuQNXj5NaEKUcOf+QZjDq9X
ig1zpicx5ELIUfwQqlnMb9D+q9nt24YphZt0ofPVoGV/DZHfIEoJOd4hXMPEqO5PeWoFUJ+FeYwZ
FNcWNALgaROamNCuTOtb7GdrlukCgYEA/vbyphz+tDfsJEblainSz/5s9qHCZrhbOZphLWcIrE/b
i+sKUcLNZ9guvYX3Sa3ixYYqE5d46TnBhtju84PvIJ199LnUh7qxqcxK81AFDnlyZcVyoGYb6JfF
A/q11RCLoNJy+jgYvzU9xEWpPUz4JClg+nxWaJM0GeOHuxJ8zqUCgYEAqVMUgApEeEUMnx87F7YD
hW56mx+QmqW5lGDSSdkaYmwPFQ9uwYLUd3Gbpx7OQ7baDIOjwU5+3TQD5Gnb2E5BA/9fcFB58vDP
q+ED1HQyMs0r2uxvg9TCqTEjXE//jBt78l39xKrUr5KLoCoRSNJQATsm/Dkz/SpYTI7t8MhzQ38C
gYEAgiYw6xa19ezt//6osS60TDRGDwe3opPNDXR+0pxb0wnYum26kM3t6Gp0QY6XEudOcSHxbJrP
v84ZueoW3/ujH3UFjN0nXjmw40pDoDxiuGbKPKUzxCkbafm/Oi7Kjv6pJ+kFhDEKgOB+rSgaIg6e
RGdS98psmWk7GVQKPzZKu3kCgYEAmv43p7S+VDEwin92AhBUTNGCXXiZT1Yf99hg5cRbSHiNncOQ
qIXvop5V0rZ6LLW2BvqA7TPDIQy5+12DJg8LqHMck5y25FDWaAkDDniGcsYoPK9srIoW3fTi319D
FqcZ4BN1dY7CPSyxrpyTUcth/J5+4yYhlr4qMXosB9oU2FUCgYEAoTYtDGFt7w1cDZvI+0sRVU9+
xqoe8Z5anfRnNSAzY3GYNoCxEs0XoxMs96RzjNKtE0e2ccSd0R4B1p1LuKyymAJT1Dn9DbKtKajf
uMKUAsgbjKv5Eo7h8xcniEHxXHueULH+b6Y5a3VIYvvdDCnzABzQLzZJb7PX0AXYUcaIzh8=
-----END RSA PRIVATE KEY-----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment