Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aws4 #254

Merged
merged 1 commit into from
May 24, 2018
Merged

Aws4 #254

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions multinode-demo/leader.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
cd /home/ubuntu/solana
git pull
export RUST_LOG=solana::crdt=trace
cat genesis.log | cargo run --release --features cuda --bin solana-testnode -- -s leader.json -b 8000 -d
export RUST_LOG=solana::crdt=info
cat genesis.log | cargo run --release --features cuda --bin solana-testnode -- -s leader.json -b 8000 -d | grep INFO
#cat genesis.log | cargo run --release --bin solana-testnode -- -s leader.json -b 8000 -d
5 changes: 3 additions & 2 deletions multinode-demo/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ cd /home/ubuntu/solana
git pull
scp ubuntu@18.206.1.146:~/solana/leader.json .
scp ubuntu@18.206.1.146:~/solana/genesis.log .
export RUST_LOG=solana::crdt=trace
cat genesis.log | cargo run --release --features cuda --bin solana-testnode -- -s replicator.json -r leader.json -b 9000 -d
scp ubuntu@18.206.1.146:~/solana/libcuda_verify_ed25519.a .
export RUST_LOG=solana=info
cat genesis.log | cargo run --release --features cuda --bin solana-testnode -- -s replicator.json -v leader.json -b 9000 -d | grep INFO
26 changes: 14 additions & 12 deletions src/bin/multinode-demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ fn main() {
nsps / 1_000_f64
);

let initial_tx_count = client.transaction_count();
let first_count = client.transaction_count();
let mut initial_tx_count = first_count;
println!("initial count {}", initial_tx_count);

println!("Transfering {} transactions in {} batches", txs, threads);
let now = Instant::now();
let mut now = Instant::now();
let sz = transactions.len() / threads;
let chunks: Vec<_> = transactions.chunks(sz).collect();
chunks.into_par_iter().for_each(|trs| {
Expand All @@ -154,11 +155,13 @@ fn main() {
}
});

println!("Waiting for transactions to complete...",);
for _ in 0..10 {
let mut tx_count = client.transaction_count();
println!("Sampling tps every second...",);
for _ in 0..20 {
let tx_count = client.transaction_count();
duration = now.elapsed();
now = Instant::now();
let txs = tx_count - initial_tx_count;
initial_tx_count = tx_count;
println!("Transactions processed {}", txs);
let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos());
let tps = (txs * 1_000_000_000) as f64 / ns as f64;
Expand All @@ -171,13 +174,12 @@ fn main() {
for val in validators {
println!("Checking balance on {} ...", val.events_addr);
let mut client = mk_client(&client_addr, &val);
let mut tx_count = client.transaction_count();
duration = now.elapsed();
let txs = tx_count - initial_tx_count;
println!("Transactions processed {} on {}", txs, val.events_addr);
let ns = duration.as_secs() * 1_000_000_000 + u64::from(duration.subsec_nanos());
let tps = (txs * 1_000_000_000) as f64 / ns as f64;
println!("{} tps on {}", tps, val.events_addr);
let tx_count = client.transaction_count();
let txs = tx_count - first_count;
println!(
"Total Transactions processed {} on {}",
txs, val.events_addr
);
}
signal.store(true, Ordering::Relaxed);
for t in c_threads {
Expand Down
10 changes: 8 additions & 2 deletions src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl Crdt {
fn gossip_request(&self) -> Result<(SocketAddr, Protocol)> {
let options: Vec<_> = self.table.values().filter(|v| v.id != self.me).collect();
if options.len() < 1 {
trace!("crdt too small for gossip");
info!("crdt too small for gossip");
return Err(Error::CrdtTooSmall);
}
let n = (Self::random() as usize) % options.len();
Expand Down Expand Up @@ -497,7 +497,13 @@ impl Crdt {
sock.set_read_timeout(Some(Duration::new(2, 0)))
.expect("'sock.set_read_timeout' in crdt.rs");
spawn(move || loop {
let _ = Self::run_listen(&obj, &window, &sock);
let e = Self::run_listen(&obj, &window, &sock);
if e.is_err() {
info!(
"run_listen timeout, table size: {}",
obj.read().unwrap().table.len()
);
}
if exit.load(Ordering::Relaxed) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ fn broadcast(
let mut blobs = dq.into_iter().collect();
/// appends codes to the list of blobs allowing us to reconstruct the stream
#[cfg(feature = "erasure")]
erasure::generate_codes(blobs);
erasure::generate_coding(re, blobs, consumed);
Crdt::broadcast(crdt, &blobs, &sock, transmit_index)?;
// keep the cache of blobs that are broadcast
{
Expand Down