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

Logging + Perf optimizations #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ license = "Apache-2.0"
edition = "2021"

[workspace.dependencies]
arc-swap = "1.7.1"
axum = "0.5.17"
bincode = "1.3.3"
bytes = "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion block_engine/src/block_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ impl BlockEngineRelayerHandler {

let mut heartbeat_interval = interval(Duration::from_millis(500));
let mut auth_refresh_interval = interval(Duration::from_secs(60));
let mut metrics_interval = interval(Duration::from_secs(1));
let mut metrics_interval = interval(Duration::from_secs(10));

let mut heartbeat_count = 0;
while !exit.load(Ordering::Relaxed) {
Expand Down
1 change: 1 addition & 0 deletions relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = { workspace = true }
publish = false

[dependencies]
arc-swap = { workspace = true }
chrono = { workspace = true }
crossbeam-channel = { workspace = true }
dashmap = { workspace = true }
Expand Down
21 changes: 4 additions & 17 deletions relayer/src/health_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
time::{Duration, Instant},
};

use crossbeam_channel::{select, tick, Receiver, Sender};
use crossbeam_channel::{select, tick, Receiver};
use solana_metrics::datapoint_info;
use solana_sdk::clock::Slot;

Expand All @@ -28,7 +28,6 @@ pub struct HealthManager {
impl HealthManager {
pub fn new(
slot_receiver: Receiver<Slot>,
slot_sender: Sender<Slot>,
missing_slot_unhealthy_threshold: Duration,
exit: Arc<AtomicBool>,
) -> HealthManager {
Expand All @@ -39,8 +38,6 @@ impl HealthManager {
.name("health_manager".to_string())
.spawn(move || {
let mut last_update = Instant::now();
let mut slot_sender_max_len = 0usize;
let channel_len_tick = tick(Duration::from_secs(5));
let check_and_metrics_tick = tick(missing_slot_unhealthy_threshold / 2);

while !exit.load(Ordering::Relaxed) {
Expand All @@ -54,24 +51,14 @@ impl HealthManager {
*health_state.write().unwrap() = new_health_state;
datapoint_info!(
"relayer-health-state",
("health_state", new_health_state, i64)
("health_state", new_health_state, i64),
("slot_receiver_len", slot_receiver.len(), i64),
);
}
recv(slot_receiver) -> maybe_slot => {
let slot = maybe_slot.expect("error receiving slot, exiting");
slot_sender.send(slot).expect("error forwarding slot, exiting");
recv(slot_receiver) -> _maybe_slot => {
last_update = Instant::now();
}
recv(channel_len_tick) -> _ => {
datapoint_info!(
"health_manager-channel_stats",
("slot_sender_len", slot_sender_max_len, i64),
("slot_sender_capacity", slot_sender.capacity().unwrap(), i64),
);
slot_sender_max_len = 0;
}
}
slot_sender_max_len = std::cmp::max(slot_sender_max_len, slot_sender.len());
}
})
.unwrap(),
Expand Down
Loading
Loading