Configuring Checkbox 7 On-Premise with Distributed Caching (Memcached or Redis)

Checkbox 7 supports the use of Memcached or Redis to create a distributed, rather than in-memory, cache.  Both of these platforms are widely used, very scalable, and free to use.

Why Use Distributed Caching?

This is most useful in web farm situations where you cannot have data stored on a single server. But it can also be useful in high volume environments or in environments where distributed cache providers are already in use.

Memcache or Redis -- Which is Recommended?

Either platform will work; However, if you are looking to install this on a Windows Server we recommend using Memcached. It comes down to a matter of personal preference and we find this platform easier to work with, especially in a Microsoft Windows environment. There are also easy to follow documents for installing Memcache on Windows.

Can I Use a Cloud Hosted Provider Such as AWS Elasticache?

Yes, AWS Elasticache a very good and scalable approach if you are already using AWS to host your Checkbox installation. With this approach, we recommend (for best performance) placing the Elasticache instance within the same VPC and on the same Subnet as your Checkbox installation. 

Setup Instructions

Please note: These are third party platforms and Checkbox cannot assist the installation or troubleshooting of Memcache or Redis. We can only assist with the configuration of the Checkbox application itself. 

Step 1: Select and Configure Memcached or Redis 

For best performance, we recommend you use a cache provider that’s on the same network as the server(s) that you’ll use to host Checkbox.

Step 2: Configure Checkbox

Prior to this, you should make sure that your Checkbox 7 installation is working properly without a distributed cache. This will make it easier to troubleshoot and isolate issues if something goes wrong.

The only file that you will need to edit is API\configs\caching.config. Here, you will enter your Memcache or Redis server and port. We suggest you leave the minPoolSize, maxPoolSize, and connectionTimeout to their defaults when performing the initial setup. Once complete, restart IIS and test the application.

Sample Configurations

Memcache

Here is a sample caching.config file for Memcached. You will need to update HOST_NAME_GOES_HERE and potentially the port based on your configuration.

<?xml version="1.0" encoding="UTF-8"?>
<Checkbox.Caching defaultProvider="Memcached">
<providers>
<memoryCache name="MemoryCache" />
<memcached name="Memcached">
<servers>
<add address="HOST_NAME_GOES_HERE" port="11211" />
</servers>
<socketPool minPoolSize="4" maxPoolSize="10" connectionTimeout="0:0:05" deadTimeout="0:0:10" />
</memcached>
<!--<memcached name="Memcached">
<servers>
<add address="{MemcachedServerAddress}" port="{MemcachedServerPort}" />
</servers>
<socketPool minPoolSize="4" maxPoolSize="10" connectionTimeout="0:0:05" deadTimeout="0:0:10" />
</memcached>
<redis name="Redis" connectionString="{RedisConnectionString}" database="{RedisDatabaseId}" />-->
</providers>
<cacheManagers>
<cacheManager name="Reporting" provider="Memcached" expirationMode="Sliding" expirationTimeout="00:30:00" />
<cacheManager name="ADUserRoles" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="ADUserGroups" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="ADGroups" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:30:00" />
<cacheManager name="ADUsers" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="Tenants" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="AccountSettings" provider="Memcached" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="MultilingualTexts" provider="Memcached" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="Surveys" provider="Memcached" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="StyleTemplates" provider="Memcached" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="ResourceAccess" provider="Memcached" expirationMode="Sliding" expirationTimeout="00:30:00" />

</cacheManagers>
</Checkbox.Caching>

 

Redis

Here is a sample caching.config file for Redis. You will need to update HOST_NAME_GOES_HERE and potentially the port (currently 6379) based on your configuration. Also, the value for database should be unique to your Checkbox installation.

<?xml version="1.0" encoding="UTF-8"?>
<Checkbox.Caching defaultProvider="Redis">
<providers>
<memoryCache name="MemoryCache" />


<redis name="Redis" connectionString="HOST_NAME_GOES_HERE:6379" database="0" />

</providers>
<cacheManagers>
<cacheManager name="Reporting" provider="Redis" expirationMode="Sliding" expirationTimeout="00:30:00" />
<cacheManager name="ADUserRoles" provider="Redis" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="ADUserGroups" provider="Redis" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="ADGroups" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:30:00" />
<cacheManager name="ADUsers" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="Tenants" provider="MemoryCache" expirationMode="Sliding" expirationTimeout="00:05:00" />
<cacheManager name="AccountSettings" provider="Redis" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="MultilingualTexts" provider="Redis" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="Surveys" provider="Redis" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="StyleTemplates" provider="Redis" expirationMode="Sliding" expirationTimeout="02:00:00" />
<cacheManager name="ResourceAccess" provider="Redis" expirationMode="Sliding" expirationTimeout="00:30:00" />

</cacheManagers>
</Checkbox.Caching>

 

0 Comments

Article is closed for comments.