]> git.kaiwu.me - nginx.git/commitdiff
SSL: improved logging of saving sessions from upstream servers.
authorSergey Kandaurov <pluknet@nginx.com>
Fri, 21 Feb 2025 11:41:33 +0000 (15:41 +0400)
committerpluknet <pluknet@nginx.com>
Wed, 26 Feb 2025 13:40:03 +0000 (17:40 +0400)
This makes it easier to understand why sessions may not be saved
in shared memory due to size.

src/http/ngx_http_upstream_round_robin.c
src/stream/ngx_stream_upstream_round_robin.c

index 6b4ff97f206366b7ca933bc4d1da76bb3c53ac3d..25741869e6ae926dbff36c6a806d65b946a0986c 100644 (file)
@@ -952,11 +952,11 @@ ngx_http_upstream_save_round_robin_peer_session(ngx_peer_connection_t *pc,
             return;
         }
 
-        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
-                       "save session: %p", ssl_session);
-
         len = i2d_SSL_SESSION(ssl_session, NULL);
 
+        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
+                       "save session: %p:%d", ssl_session, len);
+
         /* do not cache too big session */
 
         if (len > NGX_SSL_MAX_SESSION_SIZE) {
index 27db0851e22875fff37d6536e70c6f5e330e100c..1dae4e538acd24e368942efc8a177f48496040f7 100644 (file)
@@ -985,11 +985,11 @@ ngx_stream_upstream_save_round_robin_peer_session(ngx_peer_connection_t *pc,
             return;
         }
 
-        ngx_log_debug1(NGX_LOG_DEBUG_STREAM, pc->log, 0,
-                       "save session: %p", ssl_session);
-
         len = i2d_SSL_SESSION(ssl_session, NULL);
 
+        ngx_log_debug2(NGX_LOG_DEBUG_STREAM, pc->log, 0,
+                       "save session: %p:%d", ssl_session, len);
+
         /* do not cache too big session */
 
         if (len > NGX_SSL_MAX_SESSION_SIZE) {