Skip to content

Commit

Permalink
Switch to using Peak Ewma for load balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAcPT committed Nov 12, 2024
1 parent e621000 commit e621000
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nmsr-aas/src/utils/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub enum NmsrHttpClient {
inner: Buffer<
Request<SyncBody>,
<Balance<
PendingRequestsDiscover<ServiceList<Vec<HttpClientInnerService>>>,
PeakEwmaDiscover<ServiceList<Vec<HttpClientInnerService>>>,
Request<SyncBody>,
> as Service<Request<SyncBody>>>::Future,
>,
Expand Down Expand Up @@ -192,7 +192,7 @@ fn create_http_client(
.collect::<Vec<_>>();

let discover = ServiceList::new(clients);
let load = PendingRequestsDiscover::new(discover, CompleteOnResponse::default());
let load = PeakEwmaDiscover::new(discover, Duration::from_secs(1), Duration::from_millis(50), CompleteOnResponse::default());
let balanced = Balance::new(load);

let balanced = ServiceBuilder::new()
Expand Down

0 comments on commit e621000

Please sign in to comment.