Skip to content

Instantly share code, notes, and snippets.

@hdiedrich
Last active December 16, 2015 09:48
Show Gist options
  • Save hdiedrich/5415065 to your computer and use it in GitHub Desktop.
Save hdiedrich/5415065 to your computer and use it in GitHub Desktop.
Try Erlvolt and VoltDB in 4 Lines

Giving Erlvolt and VoltDB a whirl takes seconds, i.e. copy pasting these four lines. 9 minutes 20 seconds including all reading, downloading and building:

  git clone -b voltdb-3.7.0.5 https://github.com/VoltDB/voltdb.git voltdb  
  git clone https://github.com/Eonblast/Erlvolt.git erlvolt  
  cd voltdb && ant && cd examples/voter && ./run.sh &  
  cd erlvolt && make profile bench  

Once you ran the first line above, i.e. started cloning VoltDB why not read the following while waiting for the dl:

The timing should be roughly

  5" opening a terminal
  1' reading up to here
  2'30" dl VoltDB
  5'20" building VoltDB
  10" building Erlvolt
  15" running the bench

Note that you will see no system prompt after the third line but only "Server completed initialization." Then it's time to paste the fourth line and hit return.

At the end of the build and the start of VoltDB (both kicked in by the third line) your screen will look like this:

  BUILD SUCCESSFUL
  Total time: 4 minutes 6 seconds
  ------------------------------------------
  Successfully created voter.jar
  Includes schema: ddl.sql
  
  [MP][RW] AREA_CODE_STATE.delete
    DELETE FROM AREA_CODE_STATE WHERE (AREA_CODE = ?);
  
  [MP][RW] AREA_CODE_STATE.insert
    INSERT INTO AREA_CODE_STATE VALUES (?, ?);
  
  [MP][RW] AREA_CODE_STATE.update
    UPDATE AREA_CODE_STATE SET AREA_CODE = ?, STATE = ? WHERE (AREA_CODE = ?);
  
  [MP][RW] CONTESTANTS.delete
    DELETE FROM CONTESTANTS WHERE (CONTESTANT_NUMBER = ?);
  
  [MP][RW] CONTESTANTS.insert
    INSERT INTO CONTESTANTS VALUES (?, ?);
  
  [MP][RW] CONTESTANTS.update
    UPDATE CONTESTANTS SET CONTESTANT_NUMBER = ?, CONTESTANT_NAME = ? WHERE (CONTEST...
  
  [MP][RO][Seq] ContestantWinningStates
    [Seq] SELECT contestant_number, state, SUM(num_votes) AS num_votes FROM v_votes_...
  
  [MP][RO][Seq] GetStateHeatmap
    [Seq] SELECT contestant_number, state, SUM(num_votes) AS num_votes FROM v_votes_...
  
  [MP][RW] Initialize
    SELECT COUNT(*) FROM contestants;
    INSERT INTO area_code_state VALUES (?,?);
    INSERT INTO contestants (contestant_name, contestant_number) VALUES (?, ?);
  
  [MP][RO][Seq] Results
    [Seq] SELECT a.contestant_name AS contestant_name , a.contestant_number AS conte...
  
  [SP][RW] VOTES.insert
    INSERT INTO VOTES VALUES (?, ?, ?);
  
  [SP][RW] Vote
    SELECT contestant_number FROM contestants WHERE contestant_number = ?;
    SELECT state FROM area_code_state WHERE area_code = ?;
    SELECT num_votes FROM v_votes_by_phone_number WHERE phone_number = ?;
    INSERT INTO votes (phone_number, state, contestant_number) VALUES (?, ?, ?);
  
  ------------------------------------------
  Initializing VoltDB...
  
   _    __      ____  ____  ____ 
  | |  / /___  / / /_/ __ \/ __ )
  | | / / __ \/ / __/ / / / __  |
  | |/ / /_/ / / /_/ /_/ / /_/ / 
  |___/\____/_/\__/_____/_____/
  
  --------------------------------
  
  Build: 3.2 voltdb-3.1-486-gc1e8b6c Community Edition
  Connecting to VoltDB cluster as the leader...
  Host id of this node is: 0
  WARN: Running without redundancy (k=0) is not recommended for production use.
  Server completed initialization.

Then, the fourth line will give you this:

  cd erlvolt && make profile bench
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_app.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_conn.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_conn_mgr.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_profiler.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_sup.erl
  erlc -W -I ../include  -Dprofile +native -smp  -o ../ebin erlvolt_wire.erl
  erlc -W -I ../../include  -Dprofile +native -smp  -o ../../ebin bench.erl
  
  
  Erlvolt Bench 0.9 (client 'VSD')
  -----------------------------------------------------------------------------------------------------------------------------------
  Client 'VSD', voter, 100,000 calls, steady, 200 workers, delay n/a, direct, queue n/a, slots n/a, limit n/a, verbose, 5.0 stats/sec
  Hosts: localhost:21212 
  connect ...
  preparation ...
  Start at: 2013-04-18 18:14:40 .....
  Starting: 2013-04-18 18:14:40
  calls ... 
  Client   VSD: at  0.200sec: lap    4,584 T/sec,  total    4,585 T/sec, success:     917, fails: 0, pending:     200, avglat: 23.070ms, maxlat:   54ms
  Client   VSD: at  0.403sec: lap    5,838 T/sec,  total    5,228 T/sec, success:   2,107, fails: 0, pending:     200, avglat: 22.414ms, maxlat:   64ms
  Client   VSD: at  0.602sec: lap    5,565 T/sec,  total    5,335 T/sec, success:   3,212, fails: 0, pending:     200, avglat: 19.607ms, maxlat:   34ms
  Client   VSD: at  0.800sec: lap    6,854 T/sec,  total    5,708 T/sec, success:   4,567, fails: 0, pending:     200, avglat: 16.741ms, maxlat:   33ms
  Client   VSD: at  1.000sec: lap    7,412 T/sec,  total    6,052 T/sec, success:   6,052, fails: 0, pending:     200, avglat: 14.721ms, maxlat:   23ms
  Client   VSD: at  1.202sec: lap   12,528 T/sec,  total    7,141 T/sec, success:   8,584, fails: 0, pending:     139, avglat: 11.731ms, maxlat:   22ms
  Client   VSD: at  1.401sec: lap    9,850 T/sec,  total    7,527 T/sec, success:  10,546, fails: 0, pending:     200, avglat: 10.661ms, maxlat:   17ms
  Client   VSD: at  1.601sec: lap    9,178 T/sec,  total    7,734 T/sec, success:  12,383, fails: 0, pending:     200, avglat: 10.148ms, maxlat:   18ms
  Client   VSD: at  1.804sec: lap   11,072 T/sec,  total    8,110 T/sec, success:  14,632, fails: 0, pending:      80, avglat:  9.457ms, maxlat:   18ms
  Client   VSD: at  2.004sec: lap   11,205 T/sec,  total    8,417 T/sec, success:  16,868, fails: 0, pending:      33, avglat:  8.823ms, maxlat:   11ms
  Client   VSD: at  2.201sec: lap   16,779 T/sec,  total    9,168 T/sec, success:  20,180, fails: 0, pending:     103, avglat:  7.567ms, maxlat:    7ms
  Client   VSD: at  2.402sec: lap   16,761 T/sec,  total    9,803 T/sec, success:  23,547, fails: 0, pending:     113, avglat:  6.606ms, maxlat:    4ms
  Client   VSD: at  2.602sec: lap   17,096 T/sec,  total   10,363 T/sec, success:  26,967, fails: 0, pending:     112, avglat:  5.898ms, maxlat:    8ms
  Client   VSD: at  2.801sec: lap   15,871 T/sec,  total   10,753 T/sec, success:  30,120, fails: 0, pending:     128, avglat:  5.387ms, maxlat:   17ms
  Client   VSD: at  3.002sec: lap   17,660 T/sec,  total   11,215 T/sec, success:  33,669, fails: 0, pending:     115, avglat:  4.875ms, maxlat:    3ms
  Client   VSD: at  3.202sec: lap   18,085 T/sec,  total   11,646 T/sec, success:  37,292, fails: 0, pending:     142, avglat:  4.486ms, maxlat:   11ms
  Client   VSD: at  3.402sec: lap   18,156 T/sec,  total   12,026 T/sec, success:  40,913, fails: 0, pending:     136, avglat:  4.135ms, maxlat:    4ms
  Client   VSD: at  3.601sec: lap   18,578 T/sec,  total   12,389 T/sec, success:  44,613, fails: 0, pending:     101, avglat:  3.885ms, maxlat:    7ms
  Client   VSD: at  3.801sec: lap   19,054 T/sec,  total   12,739 T/sec, success:  48,422, fails: 0, pending:      94, avglat:  3.601ms, maxlat:    2ms
  Client   VSD: at  4.000sec: lap   19,005 T/sec,  total   13,055 T/sec, success:  52,220, fails: 0, pending:      92, avglat:  3.360ms, maxlat:    2ms
  Client   VSD: at  4.201sec: lap   19,114 T/sec,  total   13,344 T/sec, success:  56,059, fails: 0, pending:     116, avglat:  3.149ms, maxlat:    1ms
  Client   VSD: at  4.402sec: lap   19,281 T/sec,  total   13,613 T/sec, success:  59,927, fails: 0, pending:      81, avglat:  2.966ms, maxlat:    2ms
  Client   VSD: at  4.601sec: lap   19,337 T/sec,  total   13,860 T/sec, success:  63,770, fails: 0, pending:     139, avglat:  2.805ms, maxlat:    2ms
  Client   VSD: at  4.801sec: lap   19,112 T/sec,  total   14,078 T/sec, success:  67,591, fails: 0, pending:     114, avglat:  2.663ms, maxlat:    1ms
  Client   VSD: at  5.001sec: lap   19,120 T/sec,  total   14,280 T/sec, success:  71,416, fails: 0, pending:     111, avglat:  2.534ms, maxlat:    1ms
  Client   VSD: at  5.201sec: lap   18,776 T/sec,  total   14,455 T/sec, success:  75,182, fails: 0, pending:     132, avglat:  2.420ms, maxlat:    1ms
  Client   VSD: at  5.401sec: lap   19,056 T/sec,  total   14,624 T/sec, success:  78,989, fails: 0, pending:     123, avglat:  2.318ms, maxlat:    1ms
  Client   VSD: at  5.601sec: lap   19,388 T/sec,  total   14,793 T/sec, success:  82,861, fails: 0, pending:     120, avglat:  2.221ms, maxlat:    2ms
  Client   VSD: at  5.801sec: lap   19,596 T/sec,  total   14,960 T/sec, success:  86,783, fails: 0, pending:     128, avglat:  2.134ms, maxlat:    1ms
  Client   VSD: at  6.001sec: lap   19,551 T/sec,  total   15,114 T/sec, success:  90,702, fails: 0, pending:     106, avglat:  2.053ms, maxlat:    1ms
  Client   VSD: at  6.201sec: lap   18,611 T/sec,  total   15,226 T/sec, success:  94,419, fails: 0, pending:      91, avglat:  1.985ms, maxlat:    2ms
  Client   VSD: at  6.402sec: lap   18,708 T/sec,  total   15,335 T/sec, success:  98,176, fails: 0, pending:      94, avglat:  1.922ms, maxlat:    2ms
  Client   VSD: at  6.628sec: lap    7,580 T/sec,  total   15,070 T/sec, success:  99,889, fails: 0, pending:      57, avglat:  1.894ms, maxlat:    1ms
  cool down ... 
  check writes ... ok
  results ...  votes:     100,000 (6 contestants)
  ....Jessie Eichman:      16,782
  ......Kelly Clauss:      16,774
  .....Alana Bregman:      16,665
  ...Tabatha Gehling:      16,607
  .....Edwina Burnam:      16,588
  ....Jessie Alloway:      16,584
  close pool ...
  Client 'VSD', voter, 100,000 calls, steady, 200 workers, delay n/a, direct, queue n/a, slots n/a, limit n/a, verbose, 5.0 stats/sec
  -----------------------------------------------------------------------------------------------------------------------------------
  
  Client 'VSD' overall: 14,813 T/sec throughput, 0.00% fails, total transactions: 100,000, fails: 0, total time: 6.751sec 
  Erlvolt 0.3.3, bench started 2013-04-18 18:14:40, ended 2013-04-18 18:14:46, database: +100,000 new votes
  [++++++++++++++]
  # 'make clean fast bench' for faster, HiPE-compiled beams. 
  # 'make clean profile bench' for rolling stats during bench.

This all looks a lot nicer on a wider terminal screen.

Of course, you could be using a separate terminal for the fourth line.

If you succeeded, please leave a comment.

For context on what you just did, Erlvolt's README should be a good and fast way to dive deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment