Skip to content

Commit

Permalink
Release TLS read and write buffers when idle
Browse files Browse the repository at this point in the history
By default OpenSSL uses static large read/write buffers with TLS
connections. For memcached instances with a lot of client connections
this can quickly add up to gigabytes of memory. This options allows the
buffers to release when the clients are idle.
  • Loading branch information
tharanga authored and dormando committed Aug 26, 2022
1 parent 15ff009 commit e31abc3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tls.c
Expand Up @@ -228,6 +228,9 @@ int ssl_init(void) {
SSL_CTX_set_options(settings.ssl_ctx, SSL_OP_NO_RENEGOTIATION);
#endif

// Release TLS read/write buffers of idle connections
SSL_CTX_set_mode(settings.ssl_ctx, SSL_MODE_RELEASE_BUFFERS);

return 0;
}

Expand Down

0 comments on commit e31abc3

Please sign in to comment.