mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #48] [MERGED] feat(sandbox): add Firecracker disk I/O rate limiting (bandwidth + IOPS) #138
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/48
Author: @rogeroger-yu
Created: 7/28/2026
Status: ✅ Merged
Merged: 8/7/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/disk-rate-limit-firecracker📝 Commits (7)
ef01c5cfeat(sandbox): add Firecracker disk I/O rate limiting (bandwidth + IOPS)ab2ab1ffix(sandbox): correct disk rate limiter refill and resume reconciliation16f1722fix(sandbox): apply fresh sandbox's own disk rate limit configd394edefix(sandbox): apply disk rate limiter before I/O and reconcile per dimension26994b8fix(sandbox): refine disk rate limit validation and disable semantics3535c8bfix(sandbox): use all-zero token bucket as disable sentinel and fix fmtde45f98docs(cfg): clarify one_time_burst is a one-time start-of-VM allowance📊 Changes
5 files changed (+409 additions, -3 deletions)
View changed files
📝
config/default.toml(+7 -0)📝
src/cfg.rs(+135 -0)📝
src/sandbox/firecracker/config.rs(+9 -0)📝
src/sandbox/firecracker/instance.rs(+22 -2)📝
src/sandbox/firecracker/sandbox.rs(+236 -1)📄 Description
Summary
[machine.disk_rate_limit]with bandwidth, IOPS, and one-time burst settings (refill period is fixed at 1s so*_per_secvalues are the true sustained rate)Drive::rate_limiter) and snapshot resume (PATCH /drives, reconciled beforeresume())Closes #46
Notes on burst semantics
bandwidth_burst_bytes/iops_burstmap to Firecracker'sone_time_burst: a separate allowance granted once at VM start, consumed before the sustained bucket and not replenished. It absorbs the initial boot I/O spike; it does not raise the steady-state rate.Changes
config/default.toml: Add[machine.disk_rate_limit]section (disabled by default)src/cfg.rs: AddDiskRateLimitConfigwith validation (disabled -> skip; reject burst-without-sustained; reject values > i64::MAX)src/sandbox/firecracker/config.rs: Carry effective config inFirecrackerCommonConfigso fresh boot and resume apply the same config and it persists across pause/resumesrc/sandbox/firecracker/instance.rs: Addpatch_drive_rate_limiter()for the resume pathsrc/sandbox/firecracker/sandbox.rs: Build the pre-boot limiter for fresh drives; on resume, reconcile per dimension and use an all-zero token bucket to explicitly disable an inherited dimensionTest plan
cargo build --release)resume(); inherited limiter cleared when disabledcargo test🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.