Skip to content

Commit

Permalink
Fix args in validator script, readme version, client-demo perf print
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed Jun 2, 2018
1 parent 216510c commit 8f1a4ad
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To run a performance-enhanced fullnode on Linux, download `libcuda_verify_ed2551
it by adding `--features=cuda` to the line that runs `solana-fullnode` in `leader.sh`.

```bash
$ wget https://solana-build-artifacts.s3.amazonaws.com/v0.6.0/libcuda_verify_ed25519.a
$ wget https://solana-build-artifacts.s3.amazonaws.com/v0.5.0/libcuda_verify_ed25519.a
cargo run --release --features=cuda --bin solana-fullnode -- -l leader.json < genesis.log
```

Expand Down
4 changes: 2 additions & 2 deletions multinode-demo/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export RUST_LOG=solana=info

sudo sysctl -w net.core.rmem_max=26214400

cargo run --release --features=cuda --bin solana-fullnode -- \
-l validator.json -v leader.json -b 9000 -d < genesis.log
cargo run --release --bin solana-fullnode -- \
-l validator.json -v leader.json < genesis.log
25 changes: 21 additions & 4 deletions src/bin/client-demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ fn main() {
}
});

let sample_period = 1; // in seconds
println!("Sampling tps every second...",);
validators.into_par_iter().for_each(|val| {
let maxes: Vec<_> = validators.into_par_iter().map(|val| {
let mut client = mk_client(&client_addr, &val);
let mut now = Instant::now();
let mut initial_tx_count = client.transaction_count();
let mut max_tps = 0.0;
let mut total = 0;
for i in 0..100 {
let tx_count = client.transaction_count();
let duration = now.elapsed();
Expand All @@ -192,8 +195,11 @@ fn main() {
);
let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos());
let tps = (sample * 1_000_000_000) as f64 / ns as f64;
if tps > max_tps {
max_tps = tps;
}
println!("{}: {} tps", val.transactions_addr, tps);
let total = tx_count - first_count;
total = tx_count - first_count;
println!(
"{}: Total Transactions processed {}",
val.transactions_addr, total
Expand All @@ -204,9 +210,20 @@ fn main() {
if i > 20 && sample == 0 {
break;
}
sleep(Duration::new(1, 0));
sleep(Duration::new(sample_period, 0));
}
});
(max_tps, total)
}).collect();
let mut max_of_maxes = 0.0;
let mut total_txs = 0;
for (max, txs) in &maxes {
if *max > max_of_maxes {
max_of_maxes = *max;
}
total_txs += *txs;
}
println!("\nHighest TPS: {} sampling period {}s total transactions: {} clients: {}",
max_of_maxes, sample_period, total_txs, maxes.len());
signal.store(true, Ordering::Relaxed);
for t in c_threads {
t.join().unwrap();
Expand Down

0 comments on commit 8f1a4ad

Please sign in to comment.