From 13d76b72f835f5c41f823bb538f04ab41e3a68b9 Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Tue, 30 Jan 2024 17:21:04 -0800 Subject: [PATCH 1/2] Add fix --- internal/framework/events/loop.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/framework/events/loop.go b/internal/framework/events/loop.go index 3acda1c467..ee0a14beb9 100644 --- a/internal/framework/events/loop.go +++ b/internal/framework/events/loop.go @@ -14,11 +14,11 @@ import ( // - Otherwise, the new event will be saved for later handling. All saved events will be handled after the handling of // the current event(s) finishes. Multiple saved events will be handled at once -- they will be batched. // -// Batching is needed because, because typically handling an event (or multiple events at once) will result into -// reloading NGINX, which is the operation we want to minimize, for the following reasons: -// (1) A reload takes time - at least 200ms. The time depends on the size of the configuration including the number of -// TLS certs, available CPU cycles. -// (2) A reload can have side-effects for the data plane traffic. +// Batching is needed because handling an event (or multiple events at once) will typically result in +// reloading NGINX, which is the operation we want to minimize for the following reasons: +// (1) A reload takes time - at least 200ms. The time depends on the size of the configuration, the number of +// TLS certs, and the number of available CPU cycles. +// (2) A reload can have side-effects for data plane traffic. // FIXME(pleshakov): better document the side effects and how to prevent and mitigate them. // So when the EventLoop have 100 saved events, it is better to process them at once rather than one by one. // https://github.com/nginxinc/nginx-gateway-fabric/issues/551 From 2a18d9ccff7ad9df99194feb2eec353ad491f41e Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Tue, 30 Jan 2024 17:22:56 -0800 Subject: [PATCH 2/2] Another fix --- internal/framework/events/loop.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/framework/events/loop.go b/internal/framework/events/loop.go index ee0a14beb9..1afe5307d3 100644 --- a/internal/framework/events/loop.go +++ b/internal/framework/events/loop.go @@ -15,7 +15,7 @@ import ( // the current event(s) finishes. Multiple saved events will be handled at once -- they will be batched. // // Batching is needed because handling an event (or multiple events at once) will typically result in -// reloading NGINX, which is the operation we want to minimize for the following reasons: +// reloading NGINX, which is an operation we want to minimize for the following reasons: // (1) A reload takes time - at least 200ms. The time depends on the size of the configuration, the number of // TLS certs, and the number of available CPU cycles. // (2) A reload can have side-effects for data plane traffic.