mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Titan Session Cache
1. Added a new build option for a TITAN session cache that can hold just over 2 million session entires. 2. Reordered the cache options from largest to smallest.
This commit is contained in:
27
configure.ac
27
configure.ac
@ -665,16 +665,16 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# big cache
|
# TITAN cache
|
||||||
AC_ARG_ENABLE([bigcache],
|
AC_ARG_ENABLE([titancache],
|
||||||
[AS_HELP_STRING([--enable-bigcache],[Enable big session cache (default: disabled)])],
|
[AS_HELP_STRING([--enable-titancache],[Enable titan session cache (default: disabled)])],
|
||||||
[ ENABLED_BIGCACHE=$enableval ],
|
[ ENABLED_TITANCACHE=$enableval ],
|
||||||
[ ENABLED_BIGCACHE=no ]
|
[ ENABLED_TITANCACHE=no ]
|
||||||
)
|
)
|
||||||
|
|
||||||
if test "$ENABLED_BIGCACHE" = "yes"
|
if test "$ENABLED_TITANCACHE" = "yes"
|
||||||
then
|
then
|
||||||
AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
|
AM_CFLAGS="$AM_CFLAGS -DTITAN_SESSION_CACHE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -691,6 +691,19 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# big cache
|
||||||
|
AC_ARG_ENABLE([bigcache],
|
||||||
|
[AS_HELP_STRING([--enable-bigcache],[Enable big session cache (default: disabled)])],
|
||||||
|
[ ENABLED_BIGCACHE=$enableval ],
|
||||||
|
[ ENABLED_BIGCACHE=no ]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "$ENABLED_BIGCACHE" = "yes"
|
||||||
|
then
|
||||||
|
AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# SMALL cache
|
# SMALL cache
|
||||||
AC_ARG_ENABLE([smallcache],
|
AC_ARG_ENABLE([smallcache],
|
||||||
[AS_HELP_STRING([--enable-smallcache],[Enable small session cache (default: disabled)])],
|
[AS_HELP_STRING([--enable-smallcache],[Enable small session cache (default: disabled)])],
|
||||||
|
17
src/ssl.c
17
src/ssl.c
@ -4613,22 +4613,29 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
|
|||||||
/* basic config gives a cache with 33 sessions, adequate for clients and
|
/* basic config gives a cache with 33 sessions, adequate for clients and
|
||||||
embedded servers
|
embedded servers
|
||||||
|
|
||||||
MEDIUM_SESSION_CACHE allows 1055 sessions, adequate for servers that
|
TITAN_SESSION_CACHE allows just over 2 million sessions, for servers
|
||||||
aren't under heavy load, basically allows 200 new sessions per minute
|
with titanic amounts of memory with long session ID timeouts and high
|
||||||
|
levels of traffic.
|
||||||
BIG_SESSION_CACHE yields 20,027 sessions
|
|
||||||
|
|
||||||
HUGE_SESSION_CACHE yields 65,791 sessions, for servers under heavy load,
|
HUGE_SESSION_CACHE yields 65,791 sessions, for servers under heavy load,
|
||||||
allows over 13,000 new sessions per minute or over 200 new sessions per
|
allows over 13,000 new sessions per minute or over 200 new sessions per
|
||||||
second
|
second
|
||||||
|
|
||||||
|
BIG_SESSION_CACHE yields 20,027 sessions
|
||||||
|
|
||||||
|
MEDIUM_SESSION_CACHE allows 1055 sessions, adequate for servers that
|
||||||
|
aren't under heavy load, basically allows 200 new sessions per minute
|
||||||
|
|
||||||
SMALL_SESSION_CACHE only stores 6 sessions, good for embedded clients
|
SMALL_SESSION_CACHE only stores 6 sessions, good for embedded clients
|
||||||
or systems where the default of nearly 3kB is too much RAM, this define
|
or systems where the default of nearly 3kB is too much RAM, this define
|
||||||
uses less than 500 bytes RAM
|
uses less than 500 bytes RAM
|
||||||
|
|
||||||
default SESSION_CACHE stores 33 sessions (no XXX_SESSION_CACHE defined)
|
default SESSION_CACHE stores 33 sessions (no XXX_SESSION_CACHE defined)
|
||||||
*/
|
*/
|
||||||
#ifdef HUGE_SESSION_CACHE
|
#if defined(TITAN_SESSION_CACHE)
|
||||||
|
#define SESSIONS_PER_ROW 31
|
||||||
|
#define SESSION_ROWS 64937
|
||||||
|
#elif defined(HUGE_SESSION_CACHE)
|
||||||
#define SESSIONS_PER_ROW 11
|
#define SESSIONS_PER_ROW 11
|
||||||
#define SESSION_ROWS 5981
|
#define SESSION_ROWS 5981
|
||||||
#elif defined(BIG_SESSION_CACHE)
|
#elif defined(BIG_SESSION_CACHE)
|
||||||
|
Reference in New Issue
Block a user