Skip to content

Commit

Permalink
Improve cluster plotting GPU utilization
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Nov 26, 2024
1 parent 6b17ac8 commit ce032cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/subspace-farmer/src/cluster/plotter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use std::time::{Duration, Instant};
use subspace_core_primitives::sectors::SectorIndex;
use subspace_core_primitives::PublicKey;
use subspace_farmer_components::plotting::PlottedSector;
use subspace_farmer_components::sector::sector_size;
use subspace_farmer_components::FarmerProtocolInfo;
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
use tokio::time::MissedTickBehavior;
Expand Down Expand Up @@ -380,7 +381,11 @@ impl ClusterPlotter {
}
};

let (mut sector_sender, sector_receiver) = mpsc::channel(1);
// Allow to buffer up to the whole sector in memory to not block plotter on the
// other side
let (mut sector_sender, sector_receiver) = mpsc::channel(
sector_size(pieces_in_sector) / nats_client.approximate_max_message_size(),
);
let mut maybe_sector_receiver = Some(sector_receiver);
loop {
match tokio::time::timeout(PING_TIMEOUT, response_stream.next()).await {
Expand Down

0 comments on commit ce032cb

Please sign in to comment.