Skip to content

Instantly share code, notes, and snippets.

@spoonincode
Last active October 17, 2018 15:45
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spoonincode/fca5658326837b76fd744d39b2a25b4e to your computer and use it in GitHub Desktop.
Save spoonincode/fca5658326837b76fd744d39b2a25b4e to your computer and use it in GitHub Desktop.
eosio benchmarking notes with txn_test_gen_plugin

This general procedure was used when doing pre-dawn 3.0 performance testing as mentioned in EOSIO/eos#2078.

Network layout: 2 nodes connected to each other on same box, 1 producer, 1 generator
Hardware: AMD Ryzen at 3.9Ghz
Software: Linux 4.15; eosio compiled with Clang6 -O3
Tested on Apr25 2018 on the DAWN-2018-04-23-ALPHA branch

Make an empty directory for our configs & data, mkdir ~/eos.data, and define a logging.json that doesn't print debug information (which occurs for each txn) to the console

cat << EOF > ~/eos.data/logging.json
{
  "includes": [],
  "appenders": [{
      "name": "consoleout",
      "type": "console",
      "args": {
        "stream": "std_out",
        "level_colors": [{
            "level": "debug",
            "color": "green"
          },{
            "level": "warn",
            "color": "brown"
          },{
            "level": "error",
            "color": "red"
          }
        ]
      },
      "enabled": true
    }
  ],

  "loggers": [{
      "name": "default",
      "level": "info",
      "enabled": true,
      "additivity": false,
      "appenders": [
        "consoleout"
      ]
    }
  ]
}
EOF

Launch producer

$ ./nodeos -d ~/eos.data/producer_node --config-dir ~/eos.data/producer_node -l ~/eos.data/logging.json --http-server-address "" -p eosio -e

Launch non-producer that will generate transactions

$ ./nodeos -d ~/eos.data/generator_node --config-dir ~/eos.data/generator_node -l ~/eos.data/logging.json --plugin eosio::txn_test_gen_plugin --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin --p2p-peer-address localhost:9876 --p2p-listen-endpoint localhost:5555

Create a wallet on the non-producer and set bios contract

$ ./cleos wallet create
$ ./cleos set contract eosio ~/eos/build.release/contracts/eosio.bios/ 

Initialize the accounts txn_test_gen_plugin uses

$ curl --data-binary '["eosio", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]' http://localhost:8888/v1/txn_test_gen/create_test_accounts

Start transaction generation, this will submit 20 transactions evey 20ms (total of 1000TPS)

$ curl --data-binary '["", 20, 20]' http://localhost:8888/v1/txn_test_gen/start_generation

Note the producer console prints

eosio generated block 9b8b851d... #3219 @ 2018-04-25T16:07:47.000 with 500 trxs, lib: 3218
eosio generated block e5b3cd5d... #3220 @ 2018-04-25T16:07:47.500 with 500 trxs, lib: 3219
eosio generated block b243aeaa... #3221 @ 2018-04-25T16:07:48.000 with 500 trxs, lib: 3220

showing 1000TPS. Producer CPU usage is only ~48%

@sivachaitanya
Copy link

@spartucus - How can I achieve the same throughput without the plugin if I send the transactions using the cleos ?

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