Open Source Redis RESP Protocol Server on Windows
NCache Open Source provides a RESP listener that allows Redis-compatible clients to access a cache on Windows. The following procedure explains how to configure the listener for an NCache Open Source Replicated cache, connect from supported Redis client languages, and monitor basic cache activity. Unlike NCache, the Open Source edition does not support CRC16-based Redis Cluster routing.
Step 1: Install NCache Open Source on Windows
Install NCache Open Source on each Windows server that will host the Replicated cache.
- Obtain an evaluation license key from the NCache Downloads page.
- Open Command Prompt using Run as Administrator.
- Run the following command, replacing the placeholder with your evaluation license key:
msiexec.exe /i http://download.alachisoft.com/ncache/ncache-oss-5.3.603.msi KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /qn
For complete installation instructions, see Getting Started with NCache Open Source.
Step 2: Create a Replicated Cache
NCache Open Source supports Local and Replicated caches. The following example uses a Replicated cache named defaultCache on two nodes.
- Configure
defaultCachein%NCHOME%\config\config.ncconfon both servers (20.200.20.11and20.200.20.12). - Restart the NCache Service after updating the configuration, and verify the cache using PowerShell:
Get-Caches -Detail -Server 20.200.20.11
For the cache configuration XML and detailed instructions, see Create Cache.
Step 3: Enable NCache Open Source RESP Server
Configure the RESP listener on each cache server.
- If
defaultCacheis running, stop it using PowerShell. Repeat for each node:
Stop-Cache -Name defaultCache -Server 20.200.20.11
- Open
%NCHOME%\config\resp.ncconfand add the following listener configuration fordefaultCache:
<configuration>
<resp-servers>
<resp-server cache-id="defaultCache" enabled="true" port="9981" max-connections="1000" idle-timeout="0"/>
</resp-servers>
</configuration>
- Save the configuration on each server. Ensure that the selected port is available.
The following table describes the RESP listener attributes.
| Attribute | Description |
|---|---|
cache-id |
Specifies the cache exposed through the RESP listener. |
enabled |
Enables or disables the RESP listener for the specified cache. |
port |
Specifies the TCP port used by Redis clients to connect to the listener. |
max-connections |
Specifies the maximum number of client connections allowed. |
idle-timeout |
Specifies the connection idle timeout, in seconds. |
Note
The crc-enabled attribute is not supported in NCache Open Source and must be omitted from the RESP listener configuration. Redis-compatible CRC16 cluster routing is available only in NCache.
The example sets idle-timeout="0", disabling the idle connection timeout, and uses port 9981 from the reserved RESP range 9981–9989. Each listener on the same server requires an available port. For additional configuration details, see RESP Config (resp.ncconf). For stopping caches, see Stop-Cache.
Step 4: Start the Replicated Cache
Start the cache after saving the RESP listener configuration.
- Open PowerShell and run the following command:
Start-Cache -Name defaultCache -Server 20.200.20.11
- Repeat for the other server nodes and verify that the cache is running.
For more information, see Start-Cache and Get-Caches.
Step 5: Connect Redis Clients
Once the cache is running, connect to its RESP endpoint using redis-cli or a supported Redis client library. The examples use 20.200.20.11:9981 and assume that authentication and TLS are not enabled; when security is configured, supply the corresponding credentials and TLS options as described in NCache RESP Server Security.
Connect with redis-cli
Run the following command to verify that the RESP listener accepts Redis commands:
redis-cli -h 20.200.20.11 -p 9981 PING
A successful response is PONG. You can then use the Redis commands supported by NCache Open Source to access cache data.
Connect from Supported Client Languages
Use the following examples to connect with standard Redis client libraries. These examples demonstrate a connection and a PING command; install the corresponding client library in your application before running the code.
using StackExchange.Redis;
// Connect to the NCache Open Source RESP listener.
using var redis = await ConnectionMultiplexer.ConnectAsync("20.200.20.11:9981");
var db = redis.GetDatabase();
Console.WriteLine(await db.PingAsync());
Before using additional Redis operations, refer to the Redis RESP Protocol Compatibility Matrix and check which commands are available in NCache Open Source. Redis Cluster clients that require CRC16 hash-slot discovery are not supported by the Open Source listener.
Step 6: Monitor NCache Open Source RESP Server
NCache Open Source RESP Server can be monitored through Windows Performance Monitor (PerfMon), supported PowerShell cmdlets, cache logs, and Windows Event Viewer. These tools help inspect cache availability, request activity, and errors, including activity generated by Redis clients. The reported counters represent overall cache activity rather than RESP-specific measurements. Refer to the following documentation for procedures and available features:
- Monitor NCache
- NCache Counters
- Monitor NCache Using Windows PerfMon Tools
- Monitor NCache Using PowerShell
- Logging
See Also
Install and Configure NCache RESP Server
Connect Redis Applications to NCache RESP Server
Redis RESP Protocol Compatibility Matrix
Monitor NCache