Configuring Session Caching
By default, the Akula Server caches session data by using an internal database. While this internal database is adequate for development, it is not intended to be used in a production environment.
Akula provides built-in support for distributed caching of session data. This lets you scale your Akula Server to support a large number of concurrent users. You do this with the Memcached utility. When configured with Akula, Memcached centralizes the caching of the session ID, principal, and credentials for a single Akula Server or across multiple Akula Servers.
Memcached is a caching system for objects that runs independently of the Akula Server. By externalizing session caching, you take some load off the Akula Server. You typically configure one or more Akula Servers to run Memcached.
Memcached is not persistent, which means that if the Memcached service restarts, the session data is lost. Users will have to log in again in their apps.
This section describes the following topics:
Akula supports Memcached version 1.4.13 or later.
Memcached runs on Unix, Linux, Windows, and Mac OS X. The servers running Memcached do not need to be the same platform as the server running Akula.
Configuring Akula to use an external cache manager
You configure the external cache manager in the
AKULA_HOME/global/security-template.xml file as part of defining a security manager. For more information on the security-template.xml file and configuring security managers, see Defining a Security Manager.
This is the same file that you use to configure your authentication realm. Most of the settings are static, but you must specify the locations of the servers that are running Memcached. You must also define a name for the cache manager.
The following table describes the tags and tag attributes for the
Defines a cache manager.
This tag takes the following attributes:
Use this tag to set the following properties of the cache manager:
After editing the security-template.xml file, restart the Akula Server.
Session caching from a cluster of Akula Servers
In a simple setup, you set the
name property to a unique value in each Akula Server's security-template.xml file. When an Akula Server connects to a Memcached instance, it will only use that instance for its session caching.
You can configure your clustered Akula Servers to share one or more servers running Memcached. This increases performance in distributed environments. To do this, set the
name property to the same value in the security-template.xml file on the Akula Servers. Those Akula Servers will then share that Memcached instance.
To use Memcached:
- Install Memcached on your caching server.
- Configure the service to accept connections from remote hosts. For information about configuring Memcached, see Configuring Memcached.
- Start the Memcached service.
To test that Memcached is available and can be reached from a remote host, you can use telnet. For example:
$ telnet my.example1.com:11211