Skip to content

Commit 6e29eb6

Browse files
authored
Remove remaining IOPS/bandwidth limiting code (#1525)
After chatting in #oxide-hubris, it sounds like we want to put IOPS / bandwidth limiting into Propolis. This PR removes the remaining stubs; the actual functionality was already removed in #1506.
1 parent 134c114 commit 6e29eb6

File tree

5 files changed

+1
-133
lines changed

5 files changed

+1
-133
lines changed

aws_benchmark/bench.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ set -e
1313
# downstairs uses 512b sectors
1414
./target/release/measure-iops \
1515
-t $D0:3801 -t $D1:3801 -t $D2:3801 --samples 30 \
16-
--io-depth 8 --io-size-in-bytes $((512 * 5)) # --iop-limit 250
16+
--io-depth 8 --io-size-in-bytes $((512 * 5))
1717

measure_iops/README.md

-7
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,8 @@ Tool arguments:
3232
--samples
3333
how many samples to take (default 100). also the number of seconds the tool runs.
3434

35-
--iop-limit
36-
how many IOPs per second to set
37-
3835
--io-size-in-bytes
3936
how large of a read or write operation to send. defaults to block size.
4037

4138
--io-depth
4239
how many IOs to send at a time
43-
44-
--bw-limit-in-bytes
45-
how many bytes per second to set
46-

measure_iops/src/main.rs

-23
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,12 @@ pub struct Opt {
3737
#[clap(long, default_value = "100", action)]
3838
samples: usize,
3939

40-
#[clap(long, action)]
41-
iop_limit: Option<usize>,
42-
4340
#[clap(long, action)]
4441
io_size_in_bytes: Option<usize>,
4542

4643
#[clap(long, action)]
4744
io_depth: Option<usize>,
4845

49-
#[clap(long, action)]
50-
bw_limit_in_bytes: Option<usize>,
51-
5246
/// Submit all zeroes instead of random data
5347
#[clap(long, action)]
5448
all_zeroes: bool,
@@ -94,23 +88,6 @@ async fn main() -> Result<()> {
9488
let (guest, io) = Guest::new(None);
9589
let guest = Arc::new(guest);
9690

97-
if let Some(_iop_limit) = opt.iop_limit {
98-
// XXX fix this once implemented
99-
return Err(CrucibleError::Unsupported(
100-
"IOP limit is not implemented".to_owned(),
101-
)
102-
.into());
103-
}
104-
105-
if let Some(_bw_limit) = opt.bw_limit_in_bytes {
106-
// XXX fix this once implemented
107-
return Err(CrucibleError::Unsupported(
108-
"Bandwidth limit is not implemented".to_owned(),
109-
)
110-
.into());
111-
}
112-
113-
let guest = Arc::new(guest);
11491
let _join_handle = up_main(crucible_opts, opt.gen, None, io, None)?;
11592
println!("Crucible runtime is spawned");
11693

upstairs/src/lib.rs

-80
Original file line numberDiff line numberDiff line change
@@ -1601,86 +1601,6 @@ pub(crate) enum BlockOp {
16011601
},
16021602
}
16031603

1604-
macro_rules! ceiling_div {
1605-
($a: expr, $b: expr) => {
1606-
($a + ($b - 1)) / $b
1607-
};
1608-
}
1609-
1610-
#[allow(unused)] // pending IOP limits being reimplemented
1611-
impl BlockOp {
1612-
/*
1613-
* Compute number of IO operations represented by this BlockOp, rounding
1614-
* up. For example, if IOP size is 16k:
1615-
*
1616-
* A read of 8k is 1 IOP
1617-
* A write of 16k is 1 IOP
1618-
* A write of 16001b is 2 IOPs
1619-
* A flush isn't an IOP
1620-
*
1621-
* We are not counting WriteUnwritten ops as IO toward the users IO
1622-
* limits. Though, if too many volumes are created with scrubbers
1623-
* running, we may have to revisit that.
1624-
*/
1625-
pub fn iops(&self, iop_sz: usize) -> Option<usize> {
1626-
match self {
1627-
BlockOp::Read { data, .. } => {
1628-
Some(ceiling_div!(data.len(), iop_sz))
1629-
}
1630-
BlockOp::Write { data, .. } => {
1631-
Some(ceiling_div!(data.len(), iop_sz))
1632-
}
1633-
_ => None,
1634-
}
1635-
}
1636-
1637-
pub fn consumes_iops(&self) -> bool {
1638-
matches!(self, BlockOp::Read { .. } | BlockOp::Write { .. })
1639-
}
1640-
1641-
// Return the total size of this BlockOp
1642-
pub fn sz(&self) -> Option<usize> {
1643-
match self {
1644-
BlockOp::Read { data, .. } => Some(data.len()),
1645-
BlockOp::Write { data, .. } => Some(data.len()),
1646-
_ => None,
1647-
}
1648-
}
1649-
}
1650-
1651-
#[tokio::test]
1652-
async fn test_return_iops() {
1653-
const IOP_SZ: usize = 16000;
1654-
1655-
let op = BlockOp::Read {
1656-
offset: BlockIndex(1),
1657-
data: Buffer::new(1, 512),
1658-
done: BlockOpWaiter::pair().1,
1659-
};
1660-
assert_eq!(op.iops(IOP_SZ).unwrap(), 1);
1661-
1662-
let op = BlockOp::Read {
1663-
offset: BlockIndex(1),
1664-
data: Buffer::new(8, 512), // 4096 bytes
1665-
done: BlockOpWaiter::pair().1,
1666-
};
1667-
assert_eq!(op.iops(IOP_SZ).unwrap(), 1);
1668-
1669-
let op = BlockOp::Read {
1670-
offset: BlockIndex(1),
1671-
data: Buffer::new(31, 512), // 15872 bytes < 16000
1672-
done: BlockOpWaiter::pair().1,
1673-
};
1674-
assert_eq!(op.iops(IOP_SZ).unwrap(), 1);
1675-
1676-
let op = BlockOp::Read {
1677-
offset: BlockIndex(1),
1678-
data: Buffer::new(32, 512), // 16384 bytes > 16000
1679-
done: BlockOpWaiter::pair().1,
1680-
};
1681-
assert_eq!(op.iops(IOP_SZ).unwrap(), 2);
1682-
}
1683-
16841604
/**
16851605
* Stat counters struct used by DTrace
16861606
*/

upstairs/src/upstairs.rs

-22
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ use uuid::Uuid;
3838
/// How often to log stats for DTrace
3939
const STAT_INTERVAL: Duration = Duration::from_secs(1);
4040

41-
/// How often to do IO / bandwidth limit checking
42-
const LEAK_INTERVAL: Duration = Duration::from_millis(1000);
43-
4441
/// How often to do live-repair status checking
4542
const REPAIR_CHECK_INTERVAL: Duration = Duration::from_secs(10);
4643

@@ -92,7 +89,6 @@ pub struct UpCounters {
9289
action_guest: u64,
9390
action_deferred_block: u64,
9491
action_deferred_message: u64,
95-
action_leak_check: u64,
9692
action_flush_check: u64,
9793
action_stat_check: u64,
9894
action_repair_check: u64,
@@ -108,7 +104,6 @@ impl UpCounters {
108104
action_guest: 0,
109105
action_deferred_block: 0,
110106
action_deferred_message: 0,
111-
action_leak_check: 0,
112107
action_flush_check: 0,
113108
action_stat_check: 0,
114109
action_repair_check: 0,
@@ -141,7 +136,6 @@ impl UpCounters {
141136
/// - Client timeout
142137
/// - Client ping intervals
143138
/// - Live-repair checks
144-
/// - IOPS leaking
145139
/// - Automatic flushes
146140
/// - DTrace logging of stats
147141
/// - Control requests from the controller server
@@ -236,9 +230,6 @@ pub(crate) struct Upstairs {
236230
/// Next time to check for repairs
237231
repair_check_deadline: Option<Instant>,
238232

239-
/// Next time to leak IOP / bandwidth tokens from the Guest
240-
leak_deadline: Instant,
241-
242233
/// Next time to trigger an automatic flush
243234
flush_deadline: Instant,
244235

@@ -278,7 +269,6 @@ pub(crate) enum UpstairsAction {
278269
/// A deferred message has arrived
279270
DeferredMessage(DeferredMessage),
280271

281-
LeakCheck,
282272
FlushCheck,
283273
StatUpdate,
284274
RepairCheck,
@@ -414,7 +404,6 @@ impl Upstairs {
414404
state: UpstairsState::Initializing,
415405
cfg,
416406
repair_check_deadline: None,
417-
leak_deadline: now + LEAK_INTERVAL,
418407
flush_deadline: now + flush_interval,
419408
stat_deadline: now + STAT_INTERVAL,
420409
flush_interval,
@@ -525,9 +514,6 @@ impl Upstairs {
525514
};
526515
UpstairsAction::DeferredMessage(m)
527516
}
528-
_ = sleep_until(self.leak_deadline) => {
529-
UpstairsAction::LeakCheck
530-
}
531517
_ = sleep_until(self.flush_deadline) => {
532518
UpstairsAction::FlushCheck
533519
}
@@ -574,14 +560,6 @@ impl Upstairs {
574560
.action_deferred_message));
575561
self.on_client_message(m);
576562
}
577-
UpstairsAction::LeakCheck => {
578-
self.counters.action_leak_check += 1;
579-
cdt::up__action_leak_check!(|| (self
580-
.counters
581-
.action_leak_check));
582-
// XXX Leak check is currently not implemented
583-
self.leak_deadline = Instant::now() + LEAK_INTERVAL;
584-
}
585563
UpstairsAction::FlushCheck => {
586564
self.counters.action_flush_check += 1;
587565
cdt::up__action_flush_check!(|| (self

0 commit comments

Comments
 (0)