From d178759045a75db986f729267816a1d0a2a39271 Mon Sep 17 00:00:00 2001 From: Ziinc Date: Sat, 6 Jul 2024 03:55:25 +0800 Subject: [PATCH] perf: increase max pending buffer length (#2125) * perf: increase max pending buffer length * chore: fix failing tests --- lib/logflare/backends.ex | 2 +- test/logflare_web/plugs/buffer_limiter_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logflare/backends.ex b/lib/logflare/backends.ex index 7511b91c5..c9ffde260 100644 --- a/lib/logflare/backends.ex +++ b/lib/logflare/backends.ex @@ -21,7 +21,7 @@ defmodule Logflare.Backends do defdelegate child_spec(arg), to: __MODULE__.Supervisor - @max_pending_buffer_len 7_500 + @max_pending_buffer_len 15_000 @doc """ Retrieves the hardcoded max pending buffer length. diff --git a/test/logflare_web/plugs/buffer_limiter_test.exs b/test/logflare_web/plugs/buffer_limiter_test.exs index 3a9955577..b93b53b13 100644 --- a/test/logflare_web/plugs/buffer_limiter_test.exs +++ b/test/logflare_web/plugs/buffer_limiter_test.exs @@ -12,7 +12,7 @@ defmodule LogflareWeb.Plugs.BufferLimiterTest do end test "if buffer is full of pending, return 429", %{conn: conn, source: source} do - for _ <- 1..8_000 do + for _ <- 1..20_000 do le = build(:log_event) IngestEventQueue.add_to_table({source, nil}, [le]) end