From e621000d41f5f3d64bf859f9d1a4f822963ae38f Mon Sep 17 00:00:00 2001 From: NickAc <32451103+NickAcPT@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:40:50 +0000 Subject: [PATCH] Switch to using Peak Ewma for load balancing --- nmsr-aas/src/utils/http_client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nmsr-aas/src/utils/http_client.rs b/nmsr-aas/src/utils/http_client.rs index e8d2644..2f9cb1d 100644 --- a/nmsr-aas/src/utils/http_client.rs +++ b/nmsr-aas/src/utils/http_client.rs @@ -71,7 +71,7 @@ pub enum NmsrHttpClient { inner: Buffer< Request, >>, + PeakEwmaDiscover>>, Request, > as Service>>::Future, >, @@ -192,7 +192,7 @@ fn create_http_client( .collect::>(); 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()