]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: add more information to the "show info" output
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Jan 2014 14:19:44 +0000 (15:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Jan 2014 14:19:44 +0000 (15:19 +0100)
In addition to previous outputs, we also emit the cumulated number of
connections, the cumulated number of requests, the maximum allowed
SSL connection concurrency, the current number of SSL connections and
the cumulated number of SSL connections. This will help troubleshoot
systems which experience memory shortage due to SSL.

include/proto/ssl_sock.h
src/dumpstats.c
src/ssl_sock.c

index 5f83dbc70d6cce0f5a896c952651e98c98ae6da0..9d891d90857a5e6ed65513d80c404544668ba175 100644 (file)
@@ -29,6 +29,9 @@
 #include <types/stream_interface.h>
 
 extern struct xprt_ops ssl_sock;
+extern int sslconns;
+extern int totalsslconns;
+
 int ssl_sock_handshake(struct connection *conn, unsigned int flag);
 int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy *proxy);
 void ssl_sock_free_certs(struct bind_conf *bind_conf);
index 40b02876851f2edda76b0468b41478280a05fe46..227abc54616dfdadfe86821978ed1a1e4b055ea6 100644 (file)
@@ -2168,8 +2168,15 @@ static int stats_dump_info_to_buffer(struct stream_interface *si)
                     "Maxsock: %d\n"
                     "Maxconn: %d\n"
                     "Hard_maxconn: %d\n"
-                    "Maxpipes: %d\n"
                     "CurrConns: %d\n"
+                    "CumConns: %d\n"
+                    "CumReq: %d\n"
+#ifdef USE_OPENSSL
+                    "MaxSslConns: %d\n"
+                    "CurrSslConns: %d\n"
+                    "CumSslConns: %d\n"
+#endif
+                    "Maxpipes: %d\n"
                     "PipesUsed: %d\n"
                     "PipesFree: %d\n"
                     "ConnRate: %d\n"
@@ -2195,8 +2202,12 @@ static int stats_dump_info_to_buffer(struct stream_interface *si)
                     up,
                     global.rlimit_memmax,
                     global.rlimit_nofile,
-                    global.maxsock, global.maxconn, global.hardmaxconn, global.maxpipes,
-                    actconn, pipes_used, pipes_free,
+                    global.maxsock, global.maxconn, global.hardmaxconn,
+                    actconn, totalconn, global.req_count,
+#ifdef USE_OPENSSL
+                    global.maxsslconn, sslconns, totalsslconns,
+#endif
+                    global.maxpipes, pipes_used, pipes_free,
                     read_freq_ctr(&global.conn_per_sec), global.cps_lim, global.cps_max,
                     read_freq_ctr(&global.comp_bps_in), read_freq_ctr(&global.comp_bps_out),
                     global.comp_rate_lim,
index 31f093982cf91eb2ca4c59d89b6d50e73d8694ac..88c758b1dff552644eae25c133760bec74bc787a 100644 (file)
@@ -86,7 +86,8 @@
 #define SSL_SOCK_ST_TO_CAEDEPTH(s) ((s >> (6+16)) & 15)
 #define SSL_SOCK_ST_TO_CRTERROR(s) ((s >> (4+6+16)) & 63)
 
-static int sslconns = 0;
+int sslconns = 0;
+int totalsslconns = 0;
 
 void ssl_sock_infocbk(const SSL *ssl, int where, int ret)
 {
@@ -1129,6 +1130,7 @@ static int ssl_sock_init(struct connection *conn)
                conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN;
 
                sslconns++;
+               totalsslconns++;
                return 0;
        }
        else if (objt_listener(conn->target)) {
@@ -1151,6 +1153,7 @@ static int ssl_sock_init(struct connection *conn)
                conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN;
 
                sslconns++;
+               totalsslconns++;
                return 0;
        }
        /* don't know how to handle such a target */