gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 49/189: keepalive in nginx


From: gnunet
Subject: [taler-grid5k] 49/189: keepalive in nginx
Date: Thu, 28 Apr 2022 10:46:59 +0200

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit d07a3f9561c816a77a0b0015716c15e99377c80a
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Wed Mar 9 13:18:21 2022 +0100

    keepalive in nginx
---
 configs/etc/monitor/postgres-exporter.yaml | 88 +++++++++++++++---------------
 configs/etc/nginx/sites-enabled/proxy      |  5 ++
 2 files changed, 49 insertions(+), 44 deletions(-)

diff --git a/configs/etc/monitor/postgres-exporter.yaml 
b/configs/etc/monitor/postgres-exporter.yaml
index 5fe00fb..67c3562 100644
--- a/configs/etc/monitor/postgres-exporter.yaml
+++ b/configs/etc/monitor/postgres-exporter.yaml
@@ -229,47 +229,47 @@ pg_stat_statements:
         usage: "COUNTER"
         description: "Total time the statement spent writing blocks, in 
seconds (if track_io_timing is enabled, otherwise zero)"
 
-pg_process_idle:
-  query: |
-    WITH
-      metrics AS (
-        SELECT
-          application_name,
-          SUM(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - 
state_change))::bigint)::float AS process_idle_seconds_sum,
-          COUNT(*) AS process_idle_seconds_count
-        FROM pg_stat_activity
-        WHERE state = 'idle'
-        GROUP BY application_name
-      ),
-      buckets AS (
-        SELECT
-          application_name,
-          le,
-          SUM(
-            CASE WHEN EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change)) 
<= le
-              THEN 1
-              ELSE 0
-            END
-          )::bigint AS bucket
-        FROM
-          pg_stat_activity,
-          UNNEST(ARRAY[1, 2, 5, 15, 30, 60, 90, 120, 300]) AS le
-        GROUP BY application_name, le
-        ORDER BY application_name, le
-      )
-    SELECT
-      application_name,
-      process_idle_seconds_sum as seconds_sum,
-      process_idle_seconds_count as seconds_count,
-      ARRAY_AGG(le) AS seconds,
-      ARRAY_AGG(bucket) AS seconds_bucket
-    FROM metrics JOIN buckets USING (application_name)
-    GROUP BY 1, 2, 3
-  metrics:
-    - application_name:
-        usage: "LABEL"
-        description: "Application Name"
-    - seconds:
-        usage: "HISTOGRAM"
-        description: "Idle time of server processes"
-
+#pg_process_idle:
+#  query: |
+#    WITH
+#      metrics AS (
+#        SELECT
+#          application_name,
+#          SUM(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - 
state_change))::bigint)::float AS process_idle_seconds_sum,
+#          COUNT(*) AS process_idle_seconds_count
+#        FROM pg_stat_activity
+#        WHERE state = 'idle'
+#        GROUP BY application_name
+#      ),
+#      buckets AS (
+#        SELECT
+#          application_name,
+#          le,
+#          SUM(
+#            CASE WHEN EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change)) 
<= le
+#              THEN 1
+#              ELSE 0
+#            END
+#          )::bigint AS bucket
+#        FROM
+#          pg_stat_activity,
+#          UNNEST(ARRAY[1, 2, 5, 15, 30, 60, 90, 120, 300]) AS le
+#        GROUP BY application_name, le
+#        ORDER BY application_name, le
+#      )
+#    SELECT
+#      application_name,
+#      process_idle_seconds_sum as seconds_sum,
+#      process_idle_seconds_count as seconds_count,
+#      ARRAY_AGG(le) AS seconds,
+#      ARRAY_AGG(bucket) AS seconds_bucket
+#    FROM metrics JOIN buckets USING (application_name)
+#    GROUP BY 1, 2, 3
+#  metrics:
+#    - application_name:
+#        usage: "LABEL"
+#        description: "Application Name"
+#    - seconds:
+#        usage: "HISTOGRAM"
+#        description: "Idle time of server processes"
+#
diff --git a/configs/etc/nginx/sites-enabled/proxy 
b/configs/etc/nginx/sites-enabled/proxy
index ca687e1..913ea48 100644
--- a/configs/etc/nginx/sites-enabled/proxy
+++ b/configs/etc/nginx/sites-enabled/proxy
@@ -1,5 +1,6 @@
 upstream exchange {
   least_conn;
+  keepalive 20;
   # EXCHANGE_PROCESSES e.g.
   # server exch.perf.taler:8080;
   # server exch.perf.taler:80;
@@ -13,6 +14,7 @@ log_format taler 'm=$request_method uri=$uri s=$status '
                  'rl=$request_length '
                  'bs=$bytes_sent';
 
+# Disable logging of HEAD requests
 map $request_method $log_line {
   'HEAD' 0;
   default 1;
@@ -29,6 +31,9 @@ server {
   allow 172.16.0.0/12;
   deny all;
 
+  keepalive_timeout 10;
+  keepalive_requests 100000;
+
   location / {
      proxy_pass http://exchange;
      proxy_redirect off;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]