ooibc88 / blockbench

BLOCKBENCH: A Framework for Analyzing Private Blockchains. Blockbench contains workloads for measuring the data processing performance, and workloads for understanding the performance of different layers of Blockchain systems.
https://www.comp.nus.edu.sg/~dbsystem/fabricsharp/#/blockbench
Apache License 2.0
392 stars 174 forks source link

Help in running benchmark for Ethereum #6

Closed sanju19 closed 6 years ago

sanju19 commented 6 years ago

I am using Ubuntu 14.04 LTS and Rasberry Pi 2 for setting up the blockbench environment. I started with ethereum. After making changes in env.sh I start benchmark with ./run_bench 1 1 1.

The output from running the benchmark is at https://pastebin.com/W6TKVS1Z

My env.sh is as follows ETH_HOME=/home/sonam/blockbench/benchmark/ethereum HOSTS=$ETH_HOME/hosts CLIENTS=$ETH_HOME/clients ETH_DATA=/home/sonam/data/eth

LOG_DIR=$ETH_HOME/donothing_donothingresults_1

LOG_DIR=$ETH_HOME/yscb EXE_HOME=/home/pi/blockbench/src/macro/kvstore BENCHMARK=ycsb

My CustomGenesis file is as follows { "nonce": "0x0000000000000042", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x00", "gasLimit": "0x8000000", "difficulty": "0x1fffff", "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x3333333333333333333333333333333333333333", "alloc":{ }, "config": { "chainId": 9119, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 } }

Can you tell me where am going wrong?

ug93tad commented 6 years ago

looks like there're errors with connection to the nodes.

can you provide more info about:

sanju19 commented 6 years ago

The geth version Ubuntu is

sonam@Sonam91:~$ geth version Geth Version: 1.7.3-stable Git Commit: 4bb3c89d44e372e6a9ab85a8be0c9345265c763a Architecture: amd64 Protocol Versions: [63 62] Network Id: 1 Go Version: go1.9 Operating System: linux GOPATH= GOROOT=/usr/lib/go-1.9

For Raspberry Pi 2 geth version sonam@ethpinode1:~/blockbench/benchmark/ethereum $ geth version Geth Version: 1.7.0-stable Git Commit: 6c6c7b2af3efdad4d2f64f70f3a724af434bbcd2 Architecture: arm Protocol Versions: [63 62] Network Id: 1 Go Version: go1.7.4 Operating System: linux GOPATH= GOROOT=/usr/local/go

Ubuntu 14.04 run as the server and the Raspberry Pi 2 (Raspbian Stretch Lite OS)as the client.

sanju19 commented 6 years ago

This is the eth log after running start-all.sh

INFO [12-11|15:08:19] Starting peer-to-peer node instance=Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9 INFO [12-11|15:08:19] Allocated cache and file handles database=/home/sonam/data/eth/geth/chaindata cache=128 handles=1024 INFO [12-11|15:08:19] Initialised chain configuration config="{ChainID: 9119 Homestead: 0 DAO: DAOSupport: false EIP150: EIP155: 0 EIP158: 0 Byzantium: Engine: unknown}" INFO [12-11|15:08:19] Disk storage enabled for ethash caches dir=/home/sonam/data/eth/geth/ethash count=3 INFO [12-11|15:08:19] Disk storage enabled for ethash DAGs dir=/home/sonam/.ethash count=2 INFO [12-11|15:08:19] Initialising Ethereum protocol versions="[63 62]" network=9119 INFO [12-11|15:08:19] Loaded most recent local header number=0 hash=bf22a8…fab5e6 td=2097151 INFO [12-11|15:08:19] Loaded most recent local full block number=0 hash=bf22a8…fab5e6 td=2097151 INFO [12-11|15:08:19] Loaded most recent local fast block number=0 hash=bf22a8…fab5e6 td=2097151 INFO [12-11|15:08:19] Loaded local transaction journal transactions=0 dropped=0 INFO [12-11|15:08:19] Regenerated local transaction journal transactions=0 accounts=0 INFO [12-11|15:08:19] Starting P2P networking INFO [12-11|15:08:19] RLPx listener up self="enode://1662bff4753560897e3f7c9a886c775e458f07e7b7fa56ecf1520e2f990a3616322a63b7efcb564ad59a4c36ba536aab2583a7dec4ac499ea6ad542535ddbdd9@[::]:30303?discport=0" INFO [12-11|15:08:19] IPC endpoint opened: /home/sonam/data/eth/geth.ipc INFO [12-11|15:08:19] HTTP endpoint opened: http://127.0.0.1:8000 Fatal: Failed to unlock account 0 (could not decrypt key with given passphrase)

ug93tad commented 6 years ago

for './run_bench 1 1 1', what's the content of addPeer.txt file?

sanju19 commented 6 years ago

the contents of addPeer.txt is

admin.addPeer()

ug93tad commented 6 years ago

this file should have something like this: admin.addPeer("enode://def2074b0dc7ee8b6027a76e955fa468f34e52c72237d761e6e6619d189a8e2e35b0fe57512b54e1b02589fb78f7f68ed02ad825f5898d7f612bf73ddb94b718@10.0.0.3:30303")

since it's empty in your case, it means that the gather.sh doesn't run properly in your environment. Could be because you need password for ssh on remote node. Try to remove password login for ssh, then run:

bulldosers commented 6 years ago

also, make sure to set the ETH_DATA variable in enode.sh to the correct value

sanju19 commented 6 years ago

geth runs in the hosts but driver never runs because i get: driver: no process found so the problem must be in the clients.

My output when i run ./run_bench 1 1 1 is at https://pastebin.com/Tkt750Bd It doesn't even create log dir directory.

eth log after running run_bench is at https://pastebin.com/zMn0TBDA

my run_bench is https://pastebin.com/QxHxkzTH

ug93tad commented 6 years ago

the macro benchmarks are designed for running with >= 2 servers.

You may want to try the micro benchmark that uses only 1 server.

If you still want to use it, then here're the modified start-multi-clients.sh: https://www.dropbox.com/s/cxud3o0paivggll/start-multi-clients.sh?dl=0

and start-clients.sh: https://www.dropbox.com/s/1gz3vjack50gw9w/start-clients.sh?dl=0

and run-bench.sh takes 4 parameters, the last being the transaction rate per thread per client.

sanju19 commented 6 years ago

I modified both start-multi-clients.sh and start-clients.sh. My output for running the ./run_bench 1 1 1 10 is at https://pastebin.com/hUpN4imR

Any idea why my output is like that?

ug93tad commented 6 years ago

looks like the server failed to response. what's the server log for that run?

sanju19 commented 6 years ago

Here is my eth_log https://pastebin.com/PJ8hgPg8

ug93tad commented 6 years ago

looks like the server doesn't receive anything from the client. Can you check if the client can connect to the server at port 8000, by doing:

nc -zv <server> 8000

from the client's machine?

sanju19 commented 6 years ago

the client can connect to the server at port 8000 while running the bench, checked with nc command

sonam@ethpinode1:~ $ nc -zv 10.30.56.18 8000 Connection to 10.30.56.18 8000 port [tcp/*] succeeded!

So any idea where am I going wrong?

bulldosers commented 6 years ago

what's the output when you run run-bench.sh 1 1 1 10. The problem may be that there's no CustomGenesis_1.json file.

Can you do cp CustomGenesis_2.json CustomGenesis_1.json before starting run-bench.sh ?

sanju19 commented 6 years ago

the output when I ran run-bench.sh 1 1 1 10 is https://pastebin.com/wk6cLjQN

I created CustomGenesis_1.json file before running the bench. Here is my CustomGenesis_1.json file https://pastebin.com/ksWRaqB8

ug93tad commented 6 years ago

this output file is exactly the same as the one you have before (when running without CustomGenesis_1.json). What is the full path to the log file?

sanju19 commented 6 years ago

I created CustomGenesis_1.json even before running the bench for the first time. I tried running ./run-bench 2 16 2 10 the output is the same.

full path to the log file /home/sonam/benchmark/ethereum/yscb/exp$3""servers$1""threads$4""rates

my env.sh is ETH_HOME=/home/sonam/blockbench/benchmark/ethereum HOSTS=$ETH_HOME/hosts CLIENTS=$ETH_HOME/clients ETH_DATA=/home/sonam/data/eth

LOG_DIR=$ETH_HOME/donothing_donothingresults_1

LOG_DIR=$ETH_HOME/yscb EXE_HOME=/home/sonam/blockbench/src/macro/kvstore BENCHMARK=ycsb

One more doubt do i have to run ./install.sh in clients?

ug93tad commented 6 years ago

so for ./run-bench.sh 1 1 1 10, the log file is in /home/....../ycsb/exp_1_servers_1_threads_10_rate directory. And it is exactly the same as the log file in /home/.../ycsb/exp_2_servers_16_threads_10_rate?

The content of the file should be sightly differently, at least in line 3 and line 4.

No you don't have to run ./install.sh at the client.

sanju19 commented 6 years ago

yes the contents of file is slightly different , extra lines are there . But error is same - to address failed to query.

ug93tad commented 6 years ago

from your eth_log file, no contract was submitted to the server from the client.

can you first start run-bench.sh 1 1 1 10 let it run for 30 seconds, then from the client do the following (replacing the XXX with the address of the server). This is to test if the client can send a contract to the server. What's the output for this?

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_sendTransaction", "params": [{ "gas": "0x100000", "gasPrice": "0x0", "from": "0xe20d4947d2Bf34a4c2fC741F499A115A6192D7ad", "data": "0x6060604052610398806100126000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063693ec85e14610047578063e942b5161461010e57610042565b610002565b34610002576100a06004808035906020019082018035906020019191908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509090919050506101b0565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156101005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34610002576101ae6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050909091908035906020019082018035906020019191908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509090919050506102aa565b005b6020604051908101604052806000815260200150600060005082604051808280519060200190808383829060006004602084601f0104600302600f01f15090500191505090815260200160405180910390206000508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102995780601f1061026e57610100808354040283529160200191610299565b820191906000526020600020905b81548152906001019060200180831161027c57829003601f168201915b505050505090506102a5565b919050565b80600060005083604051808280519060200190808383829060006004602084601f0104600302600f01f15090500191505090815260200160405180910390206000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061033557805160ff1916838001178555610366565b82800160010185558215610366579182015b82811115610365578251826000505591602001919060010190610347565b5b5090506103919190610373565b8082111561038d5760008181506000905550600101610373565b5090565b50505b505056"}],"id":1}' http://XXX.XXX.XXX.XXX:8000

sanju19 commented 6 years ago

after running run-bench.sh 1 1 1 10 the eth_log is https://pastebin.com/aheQLfsP

sonam@ethpinode1:~ $ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_sendTransaction", "params": [{ "gas": "0x100000", "gasPrice": "0x0", "from": "0x9e2122ac1fa5a278a9f92977d679ab53e0741ca0", "data": "0x6060604052610398806100126000396000f360606040526000357c010000000000000000000000000000000000000000000000000000000090048063693ec85e14610047578063e942b5161461010e57610042565b610002565b34610002576100a06004808035906020019082018035906020019191908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509090919050506101b0565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156101005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34610002576101ae6004808035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050909091908035906020019082018035906020019191908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509090919050506102aa565b005b6020604051908101604052806000815260200150600060005082604051808280519060200190808383829060006004602084601f0104600302600f01f15090500191505090815260200160405180910390206000508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102995780601f1061026e57610100808354040283529160200191610299565b820191906000526020600020905b81548152906001019060200180831161027c57829003601f168201915b505050505090506102a5565b919050565b80600060005083604051808280519060200190808383829060006004602084601f0104600302600f01f15090500191505090815260200160405180910390206000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061033557805160ff1916838001178555610366565b82800160010185558215610366579182015b82811115610365578251826000505591602001919060010190610347565b5b5090506103919190610373565b8082111561038d5760008181506000905550600101610373565b5090565b50505b505056"}],"id":1}' http://10.30.56.18:8000

{"jsonrpc":"2.0","id":1,"result":"0x5687eec51f017c20b548a172c36cfb7087611a46374b98a6e0c6cb059467ae04"}

I submitted this twice.

But still the output is same https://pastebin.com/EVjzBGMH They why the workload is not being submitted?

ug93tad commented 6 years ago

after submitting the contract, wait for another 10 seconds, then do (replacing YYYY with content of "result" from the previous command):

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_getTransactionReceipt", "params":["YYYYYYYYY],"id":1}' http://XXXXXX:8000

sanju19 commented 6 years ago

I am getting this

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_getTransactionReceipt", "params":["0x7d2f0a20b0029520ea1878bf7cbbc4cd945dfad146a345de3e108abea3052b7e"],"id":1}' http://10.30.56.18:8000

{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x3d88628cba21190efc0c4ab4b584ea2f99181e4a439a134bb655b4e58f7da16f","blockNumber":"0x8","contractAddress":"0x4484ea23379105716efc3610161f90256fe799f4","cumulativeGasUsed":"0x4883a","from":"0xb799781446947c07728ff7a4710ec4588d331e29","gasUsed":"0x4883a","logs":[],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","root":"0xbc0fdb6d7cb4335e576b39df2a049031bcfa095dd0ed2d1297d08bfa5e1c5968","to":null,"transactionHash":"0x7d2f0a20b0029520ea1878bf7cbbc4cd945dfad146a345de3e108abea3052b7e","transactionIndex":"0x0"}}

My eth_log https://pastebin.com/4kCLFd4Q

ug93tad commented 6 years ago

looks like the client is working properly, there shouldn't be a "Failed to query" error. Can you do another run, and post all the log files here (client, server, and run-bench.sh log)?

sanju19 commented 6 years ago

run-bench.sh 1 1 1 10 log is https://pastebin.com/nuKr8DWA eth_log is https://pastebin.com/NEdmsWBJ client log https://pastebin.com/suxhvcyE

Still the same error Maybe the problem is in restclient-cpp?

ug93tad commented 6 years ago

what's the output when you run make clean; make inside src/macro/kvstore at the client?

sanju19 commented 6 years ago

make clean output is https://pastebin.com/MWNpukBu make all output is https://pastebin.com/ckZKL9p9

ug93tad commented 6 years ago

doesn't look like there's any problem with restclient-cpp.

If after recompiling the driver and the problem still persists, then I'm pretty much out of idea.

sanju19 commented 6 years ago

after recompiling the driver, I ran the bench the problem still persists.

sanju19 commented 6 years ago

I got it right. a small mistake on my part. Thank you for all your suggestions.

Can you tell me how to run micro benchmarks?

bulldosers commented 6 years ago

We have update the micro/script for geth v1.7 and you could refer to https://github.com/ooibc88/blockbench/blob/master/src/micro/README.md for micro benchmarks.

sanju19 commented 6 years ago

I am doing cpuheavy micro bench. I ran ./start-ethereum.sh in one terminal in the server. in another terminal when I ran node deploy.js 10000 it showing var sorterContract = web3.eth.contract(sorterABI); ^ TypeError: web3.eth.contract is not a function web3.personal.unlockAccount(web3.eth.accounts[0], ""); ^ TypeError: Cannot read property 'unlockAccount' of undefined

Same kind of error when I ran ioheavy and analytic micro benchmark.

Any idea where I am going wrong?

bulldosers commented 6 years ago

Do you use npm install to download the node.js module ? Or is there some error log for ./start-ethereum.sh? I think these errors are due to a lack of dependecy packages or version issues. You could use rm package-lock.json first and npm install again.

sanju19 commented 6 years ago

Thanks got it.

When you run cpuheavy bench you will get execution time. But how will I get memory usage?

Also when we run analytics benchmark, am i running txn_gen.js, node bench_q1.js start_block end_block, node bench_q2.js start_block end_block account in server itself?

sanju19 commented 6 years ago

is this how the output looks like when you run analytics benchmark? node bench_q2 3 100 0x12f029d57082315085bfb4d4d8345c92c5cdd881 undefined Latency: 0.073 sec

bulldosers commented 6 years ago

Thanks for your reminding. You could download the latest bench_q2.js and run it again.

sanju19 commented 6 years ago

is this correct output? sonam@Sonam91:~/blockbench/src/micro/analytic/ethereum$ node bench_q2 3 10000 0x12f029d57082315085bfb4d4d8345c92c5cdd881 checking: 10000 checking: 9000 checking: 8000 checking: 7000 checking: 6000 checking: 5000 checking: 4000 checking: 3000 checking: 2000 checking: 1000

Latency: 4.41 sec
bulldosers commented 6 years ago

This is due to there is not so many block minted at now. So, you could use a smaller block number like node bench_q2 3 100 0x12f029d57082315085bfb4d4d8345c92c5cdd881 or wait for more block being minted.

sanju19 commented 6 years ago

Can you tell me why sometimes latency becomes negative like bellow while running ycsb benchmark?

polled block 131 : 128 txs In the last 2s, tx count = 128 latency = -2.14748 outstanding request = 1569 In the last 2s, tx count = 0 latency = 0 outstanding request = 1617 polled block 132 : 128 txs

ug93tad commented 6 years ago

no, the latency should never be negative. there must be some problem with your client's clocks. the client uses clock_gettime(.) function at nanosecond granuality.

sanju19 commented 6 years ago

when I run smallbank ./run 1 16 1 10, this is the client log is https://pastebin.com/L8XurZ61 Is this right? this is my ./start-client.sh https://pastebin.com/RVUgrgJY Why is all the latency 0? Am I doing something wrong?

bulldosers commented 6 years ago

For smallbank, you need to modify EXE_HOME=$ETH_HOME/../../src/macro/kystore to EXE_HOME=$ETH_HOME/../../src/macro/smallbank in env.sh.

sanju19 commented 6 years ago

Already made that change. This is my env.sh ETH_HOME=/home/sonam/blockbench/benchmark/ethereum HOSTS=$ETH_HOME/hosts CLIENTS=$ETH_HOME/clients ETH_DATA=/home/sonam/data/eth

LOG_DIR=$ETH_HOME/donothing_donothingresults_1

LOG_DIR=$ETH_HOME/macro/yscb

EXE_HOME=/home/sonam/blockbench/src/macro/kvstore

BENCHMARK=ycsb

comment these out for smallbank

LOG_DIR=$ETH_HOME/macro/smallbank EXE_HOME=/home/sonam/blockbench/src/macro/smallbank BENCHMARK=smallbank

This is my start-client.sh https://pastebin.com/RVUgrgJY So any idea where am I going wrong?

ArnChe commented 6 years ago

@sanju19 , what was your small mistake running the benchmark? I try to set it up and got the same problems.

sanju19 commented 6 years ago

my issue is still there. Did you get an idea what's wrong?