MINOR: cli: add more information to the "show info" output
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.
diff --git a/include/proto/ssl_sock.h b/include/proto/ssl_sock.h
index 5f83dbc..9d891d9 100644
--- a/include/proto/ssl_sock.h
+++ b/include/proto/ssl_sock.h
@@ -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);
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 40b0287..227abc5 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -2168,8 +2168,15 @@
"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 @@
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,
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 31f0939..88c758b 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -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 @@
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 @@
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 */