Skip to content

Commit

Permalink
fix: rollback capture concurrency limit (#24462)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverb123 authored Aug 19, 2024
1 parent 3a0d758 commit 20afdc1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion rust/capture/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ thiserror = { workspace = true }
time = { workspace = true }
tokio = { workspace = true }
tower-http = { workspace = true }
tower = { workspace = true }
tracing = { workspace = true }
tracing-opentelemetry = { workspace = true }
tracing-subscriber = { workspace = true }
Expand Down
3 changes: 0 additions & 3 deletions rust/capture/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use axum::{
Router,
};
use health::HealthRegistry;
use tower::limit::ConcurrencyLimitLayer;
use tower_http::cors::{AllowHeaders, AllowOrigin, CorsLayer};
use tower_http::trace::TraceLayer;

Expand All @@ -20,7 +19,6 @@ use crate::prometheus::{setup_metrics_recorder, track_metrics};

const EVENT_BODY_SIZE: usize = 2 * 1024 * 1024; // 2MB
const BATCH_BODY_SIZE: usize = 20 * 1024 * 1024; // 20MB, up from the default 2MB used for normal event payloads
const BATCH_CONCURRENCY_LIMIT: usize = 25; // We deploy these pods with 1G of memory, this and the above lets half of that be used for batch posts

#[derive(Clone)]
pub struct State {
Expand Down Expand Up @@ -74,7 +72,6 @@ pub fn router<
.get(v0_endpoint::event)
.options(v0_endpoint::options),
)
.layer(ConcurrencyLimitLayer::new(BATCH_CONCURRENCY_LIMIT))
.layer(DefaultBodyLimit::max(BATCH_BODY_SIZE)); // Have to use this, rather than RequestBodyLimitLayer, because we use `Bytes` in the handler (this limit applies specifically to Bytes body types)

let event_router = Router::new()
Expand Down

0 comments on commit 20afdc1

Please sign in to comment.