Session Cache Configuration

Session Cache Configuration

The storage configuration includes session cache configuration.

There are three types of session cache supported

  • in-memory
  • db
  • redis
  • Session cache properties for in-memory type:

    Session Cache PropertiesDescriptionDefault
    life_timeSpecifies the session entry duration in seconds.600
    max_entriesSpecifies the maximum number of session entries.60000
    runtime_db: mypq                                            # Configuration of runtime database. Points to the database server connection.
    session_cache:
      type: in-memory
      life_time: 600
      max_entries: 60000              
    
  • For db type, the runtime_db configuration is used for session storage as well.

  • For redis configuration, update the deployment, hosts, credential and ssl_settings in the following storage configuration example.

runtime_db: mypq                                            # Configuration of runtime database. Points to the database server connection.
session_cache:
  type: redis                                               # Specifies the type of session cache, in-memory, redis, or db.
  cfg: redis-standalone                                     # Specifies the configuration of the `redis` cache, for `redis` type only. Points to `redis` server connection
server_connections:                                         # Server connections
  - name: mypq                                              # Connection name
    ...                      
  - name: ldap_staging                                      # Connection name
    ...
  - name: redis-standalone                                  # Connection name
    type: redis                                             # Connection type
    deployment:                                             # Redis deployment information. for `redis` type only
      model: standalone                                     # Deployment model. standalone or sentinel
      # master: master                                      # Master node information. For `sentinel` model only
    hosts:                                                  # List of host information (IP and port)
      - hostname: redis                                     # Server's hostname
        hostport: 6390                                      # Server's host port
    credential:                                             # Credential information to connect to the host.
      username: isva                                        # Specifies the username to access the server
      password: 'OBF:oUqHV/2VlAeWb1D7uAdfQysti3vh44p5/rpCDR35gn4=' # 
                                                            # Specifies the password for the redis server connection. It is recommended to obfuscate this.
    ssl:
      certificate:                                          # The SSL connection certificate array.
        - ks:redis_keys                                     # The SSL keystore to be used for SSL connections. ks: indicates keystore.
      mutual_auth:
        key: ks:rt_profile_keys/redis                       # When mutual TLS is needed, specify the keystore and label that contains the client's private key.
        certificate: ks:rt_profile_keys/redis               # When mutual TLS is needed, specify the keystore and label of the client's leaf certificate.
        ca:                                                 # The mutual_auth connection certificate array.
          - ks:rt_profile_keys/ca                           # When mutual TLS is needed, specify the keystore and label of the client's CA certificate.
      disable_hostname_verification: false                  # The SSL connection validates the hostname.

1. Server connections

NameDescriptionValid ValueMandatoryDefault
nameConnection namestringYes
typeConnection typeredisYes
hostsList of host information (IP and port)HostInfoYes
credentialCredential information to connect to the serverCredential
sslSSL settings.SSLSettings
conn_settingsConnection pool settings.ConnectionSettings
deploymentRedis deployment information.RedisDeploymentYes

1.1. Host information

NameDescriptionValid ValueMandatoryDefault
hostnameRedis Server's hostnamestringYes
hostportRedis Server's host portintegerYes
credentialCredential information to connect to the Redis Server.Credential
sslSSL settings for the server. It can be specified at the top level if the settings are common across hosts.SSLSettings
conn_settingsConnection pool settings for the session cache server. It can be specified at the top level if the settings are common across hosts.ConnectionSettings

Note: For Redis Server, specify credential, ssl_settings and conn_settings at the top level only.

1.2. Credential

NameDescriptionValid ValueMandatoryDefault
usernameSpecifies the username to access the server. This can be omitted if the server type is redis, and does not use a usernamestringNo
passwordSpecifies the password to access the server. Use obfuscation.stringYes

1.3. SSL settings

NameDescriptionValid ValueMandatoryDefault
certificateThe array of SSL certificates to be used for SSL connection to the session cache.stringNo
mutual_auth
keyWhen mutual TLS is needed, specify the keystore and label that contains the client's private key.stringNo
certificateWhen mutual TLS is needed, specify the keystore of the client's leaf certificate.stringNo
caWhen mutual TLS is needed, specify an array of CA certificates needed for the connection.stringNo
disable_hostname_verificationThe flag to enable or disable hostname verification for SSL connections.BooleanNo

1.4. Connection settings

NameDescriptionValid ValueMandatoryDefault
max_pool_sizeMaximum connection pool size.integerNo50
min_idle_sizeMinimum connection idle size.integerNo3
aged_timeoutAge timeout, in seconds.integerNo10
connect_timeoutConnect timeout, in seconds.integerNo5
idle_timeoutIdle timeout, in seconds.integerNo10
io_timeoutInput/Output timeout, in seconds.integerNo10

1.5. Redis deployment

NameDescriptionValid Value
modelDeployment model.standalone or sentinel
masterMaster node information. For sentinel model onlystring