[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: hydra: nginx: Keep connections alive between NGinx and nar-herder
From: |
Christopher Baines |
Subject: |
02/02: hydra: nginx: Keep connections alive between NGinx and nar-herder. |
Date: |
Thu, 7 Jul 2022 17:33:27 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository maintenance.
commit 5ba49518f864f175b052d6ba3b20ad22c3d9b647
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Jul 7 22:28:00 2022 +0100
hydra: nginx: Keep connections alive between NGinx and nar-herder.
This should remove some overhead when processing requests, hopefully
decreasing latency and increasing throughput.
* hydra/bayfront.scm (%bordeaux.guix.gnu.org-nginx-servers): Use HTTP
1.1 and clear the Connection header.
<services>[nginx]: Configure the nar-herder upstream to keep
connections alive.
---
hydra/bayfront.scm | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 72b7df7..4faa582 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -582,6 +582,8 @@ add_header Content-Type text/plain;")))
(uri "~ \\.narinfo$")
(body '("
proxy_pass http://nar-herder;
+ proxy_http_version 1.1;
+ proxy_set_header Connection \"\";
# For HTTP pipelining. This has a dramatic impact on performance.
client_body_buffer_size 128k;
@@ -591,10 +593,14 @@ add_header Content-Type text/plain;")))
")))
(nginx-location-configuration
(uri "~ \\.narinfo/info$")
- (body '("proxy_pass http://nar-herder;")))
+ (body '("proxy_pass http://nar-herder;"
+ "proxy_http_version 1.1;"
+ "proxy_set_header Connection \"\";")))
(nginx-location-configuration
(uri "/nar/")
- (body '("proxy_pass http://nar-herder;")))
+ (body '("proxy_pass http://nar-herder;"
+ "proxy_http_version 1.1;"
+ "proxy_set_header Connection \"\";")))
(nginx-named-location-configuration
(name "nar-storage")
(body '("rewrite /internal/(.*) /$1 break;"
@@ -604,13 +610,19 @@ add_header Content-Type text/plain;")))
"proxy_ignore_client_abort on;")))
(nginx-location-configuration
(uri "= /latest-database-dump")
- (body '("proxy_pass http://nar-herder;")))
+ (body '("proxy_pass http://nar-herder;"
+ "proxy_http_version 1.1;"
+ "proxy_set_header Connection \"\";")))
(nginx-location-configuration
(uri "= /recent-changes")
- (body '("proxy_pass http://nar-herder;")))
+ (body '("proxy_pass http://nar-herder;"
+ "proxy_http_version 1.1;"
+ "proxy_set_header Connection \"\";")))
(nginx-location-configuration
(uri "= /metrics")
- (body '("proxy_pass http://nar-herder;")))
+ (body '("proxy_pass http://nar-herder;"
+ "proxy_http_version 1.1;"
+ "proxy_set_header Connection \"\";")))
(nginx-location-configuration
(uri "~ ^/internal/database/(.*)$")
(body '("internal;"
@@ -1025,7 +1037,10 @@ add_header Content-Type text/plain;")))
(servers '("localhost:8745")))
(nginx-upstream-configuration
(name "nar-herder")
- (servers '("localhost:8734")))
+ (servers '("localhost:8734"))
+ (extra-content
+ '("keepalive 4;"
+ "keepalive_requests 10000;")))
(nginx-upstream-configuration
(name "nar-storage")
(servers '("bishan.guix.gnu.org:443")))))