mnm_core/limits.rs
1//! Shared size limits used across the server (body cap) and CLI (upload batching).
2
3/// Maximum HTTP request body the server accepts on ingest endpoints.
4///
5/// Also the figure the CLI sizes upload batches against. 25 MiB: enough
6/// headroom for a size-aware upload batch (which targets ~85% of this) plus the
7/// rough-estimate slack, while staying below a memory-exhaustion threshold on a
8/// small machine.
9pub const MAX_INGEST_BODY_BYTES: usize = 25 * 1024 * 1024;
10
11#[cfg(test)]
12mod tests {
13 use super::MAX_INGEST_BODY_BYTES;
14
15 #[test]
16 fn max_ingest_body_bytes_is_25_mib() {
17 assert_eq!(MAX_INGEST_BODY_BYTES, 25 * 1024 * 1024);
18 }
19}