Skip to content

Instantly share code, notes, and snippets.

@deadtrickster
Last active October 3, 2016 10:01
Show Gist options
  • Save deadtrickster/2d275f55c91e121d0d17844390a2f0fb to your computer and use it in GitHub Desktop.
Save deadtrickster/2d275f55c91e121d0d17844390a2f0fb to your computer and use it in GitHub Desktop.
prom ets optimization

Isolated test

Before:

7> benchmark:run(100, 1*1000*1000).
{1190.6,100000000}

After:

7> benchmark:run(100, 1*1000*1000).
{2.6,100000000}

#elixirlang Plugs

Before:

~/wrk/wrk -d30s -c256 -t16 http://localhost:8088/profiles/1/
Running 30s test @ http://localhost:8088/profiles/1/
  16 threads and 256 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.05ms    1.91ms  32.67ms   72.76%
    Req/Sec     2.00k   398.69    17.21k    89.42%
  954547 requests in 30.10s, 243.23MB read
Requests/sec:  31712.45
Transfer/sec:      8.08MB

After:

~/wrk/wrk -d30s -c256 -t16 http://localhost:8088/profiles/1/
Running 30s test @ http://localhost:8088/profiles/1/
  16 threads and 256 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.65ms    1.12ms  50.43ms   87.19%
    Req/Sec     3.47k   382.68     9.47k    83.69%
  1659848 requests in 30.10s, 422.95MB read
Requests/sec:  55146.19

Without instrumentation:

~/wrk/wrk -d30s -c256 -t16 http://localhost:8088/profiles/1/
Running 30s test @ http://localhost:8088/profiles/1/
  16 threads and 256 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.62ms    1.29ms  29.34ms   89.28%
    Req/Sec     3.50k   509.45     8.03k    84.80%
  1676601 requests in 30.10s, 427.22MB read
Requests/sec:  55703.20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment