Serial device rate limiter#5824
Conversation
a98212f to
f1a86a9
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5824 +/- ##
==========================================
- Coverage 83.07% 83.04% -0.04%
==========================================
Files 275 275
Lines 29462 29528 +66
==========================================
+ Hits 24476 24521 +45
- Misses 4986 5007 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f1a86a9 to
e57c5ff
Compare
e57c5ff to
7dcf338
Compare
7dcf338 to
4468f30
Compare
d673b55 to
9438dca
Compare
3afef5e to
b529745
Compare
Restructure SerialOut from an enum to a struct wrapping SerialOutInner + TokenBucket. The Write impl rate-limits guest output via a token bucket, dropping excess bytes when the budget is empty. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Add an optional rate_limiter field (TokenBucket) to the SerialConfig definition in the Firecracker swagger spec. When present, guest writes to the serial port that exceed the configured rate are silently dropped and counted in the uart.rate_limiter_dropped_bytes metric. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Add the serial endpoint to the API Endpoints table, the SerialConfig schema with serial_out_path and rate_limiter fields to the Input Schema table, and update the TokenBucket footnote to include serial. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
b529745 to
f1d2789
Compare
Manciukic
left a comment
There was a problem hiding this comment.
Mostly LGTM, just one nit. Also, we should update the `docs/prod-host-setup.md as well:
Firecracker does
not offer users the option to limit serial data transfer, nor does it impose any
restrictions on stdout handling.
Advertise the rate limiter as a recommended measure for serial device in prod host setup. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Add test_serial_rate_limiting to test_serial_io.py. The test configures a rate limiter via the PUT /serial API before boot. Update fcmetrics.py schema with the new uart metric field: rate_limiter_dropped_bytes. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Add an entry under [Unreleased] > Added describing the new serial console output optional rate limiting feature. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
f1d2789 to
0143259
Compare
Thanks, updated. |
Changes
Add optional rate limiter to the serial device
Reason
To be able to limit the amount of console output generated by the guest.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.