• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
  • Cache Settings
  • Configuration Files
  • Client Side Configurations
  • Client Config
Show / Hide Table of Contents
  • Administrator's Guide
  • NCache Architecture
    • Cache Topologies
      • Partitioned Topologies
      • Replicated Topology
      • Mirrored Topology
      • Scalability in Topologies
    • Dynamic Clustering
    • Local Cache
    • Cache Client
    • Client Cache
    • Bridge for WAN Replication
    • Connectivity with Load Balancer
    • Serialization Format
    • Data Encryption
    • Data Compression
    • Data Load Balancing
    • Pipelining
    • Cache Server Backward Compatibility
    • Client Backward Compatibility
    • Eviction
    • Indexing
    • Split-Brain
    • Maintenance Mode
    • Runtime Data Sharing
    • Portable Data Types
    • Class Versioning
    • IP Binding with Multiple NICs
    • Graceful Node Down
    • Separate Cache Host Process
    • Self Healing Dynamic Clustering
    • Distributed Cache with Persistence
  • NCache Management Center
  • Configure Caches
    • Create a Cache
      • Local Cache Overview
        • Local Cache
        • Local Cache with Persistence
        • Pub/Sub Messaging Cache
        • Add Existing Cache
      • Clustered Cache Overview
        • Distributed Cache
        • Persistent Distributed Cache
        • Pub/Sub Messaging Cache
        • Add Existing Clustered Cache
        • Troubleshooting
    • Remove Cache
    • Clear Cache
    • Add Server Node
    • Remove Server Node
    • Add Test Data
    • Configure Query Indexes
    • Configure JSON Query Indexes
    • Compact Serialization
      • Non-Generic Registration
      • Non-Generic Unregistration
      • Generic Registration
      • Using Type Handler
    • Deploy Providers
    • Configure Custom Dependency
    • Add Data Source Providers
      • Read-Through Provider
      • Write-Through Provider
      • Write-Behind Provider
    • Loader and Refresher
    • Configure Maintenance Mode
      • Stop for Maintenance Mode
      • Exit Maintenance Mode
    • Configure LINQPad
      • Configure LinqPad for NCache
      • Querying Data in LinqPad
  • Configure Clients
    • Add Client Node
    • Remove Client Node
  • Configure Client Cache
    • Create Client Cache
    • Create Client Cache with NuGet
    • Enable Client Cache on Client Nodes
    • Disable Client Cache on Client Nodes
    • Remove Client Cache
  • Management Operations
    • Start Cache
    • Stop Cache
    • Restart Cache
    • Manage Cache Service on a Server Node
    • Memory Dumps
    • Data Load Balancing
    • Invoke Refresher Dataset
    • Import/Export Cache Data
    • Import Lucene Indexes
    • Suspend/Resume NCache Data Persistence
    • Backup and Restore NCache Persisted Data
  • Cache Settings
    • General Cache Settings
      • Cache Size
      • Cache Isolation Levels
      • Cache Serialization Format
      • Cache Data Expiration
    • Cache Cluster Settings
      • Ports
      • Operation Timeout
      • Configure Pipelining
      • Static Replication Interval
      • Connection Retries
      • Retry Interval
      • Split-Brain Auto Recovery
    • NCache Persistence Settings
      • Store Information
      • Persistence Interval
    • Error Logging
    • Cache Level Events
    • Client Activity Events
    • Eviction Policy
    • MapReduce
    • Register Classes for Portable Data Sharing
    • Compression
    • Email Notifications
    • Bind IP with Multiple NICs
      • Bind Cluster with a Dedicated IP
      • Bind Client/Server with a Dedicated IP
    • Heartbeat
    • Keep Alive
    • Client Death Detection
    • Communication Reliability
    • Auto Start Cache on Boot
    • Nagle's Algorithm
    • Dual Socket
    • Configuration Files
      • Client Side Configurations
        • Client Config
        • EFCaching Config
      • Server Side Configurations
        • Cache Config
        • Bridge Config
        • Modules Config
        • Security Config
        • TLS Config
        • Monitoring Config
        • Emails Template
  • Cache Server Settings
    • Server Connectivity
    • Bind to Multiple NICs
    • Server Ports
    • Memory
    • Custom Dependency
    • Request Inquiry
    • Windows Events
    • Message Events
    • Expiration & Eviction
    • SQL Server
    • Logging
    • Monitoring
    • Persistence Data Loading Retries
    • Miscellaneous Configurations
  • Bridge Server Settings
  • Cache Client Settings
  • Client Cache Settings
  • Configure Security
    • Configure Authentication and Authorization
    • Configure Encryption for Cache
    • Configure TLS Encryption
    • Configure HTTPS for NCache Management Center
  • Configure Bridge for WAN Replication
    • Create Bridge
    • Add Clustered Caches to Bridge
    • Configure Bridge Settings
    • Change Cache Synchronization Modes
    • Bridge Management
    • Synchronize Caches in Bridge
    • Leave Bridge
    • Remove Cache from Bridge
    • Configure Conflict Resolver
  • Setup Database for Cache Synchronization
    • Setup SQL Server Environment
    • Setup Oracle Database Environment
    • Setup OleDb Environment
    • Setup SQL Server for CLR Procedures
  • Simulate NCache Usage
  • Monitor Caches
    • Counters
      • Distributed Cache Counters
      • Distributed Cache with Persistence Counters
      • Pub/Sub Messaging Cache Counters
      • Distributed Lucene Cache Counters
      • Cache Client Counters
      • Bridge Counters
    • Monitor NCache using the NCache Management Center
      • Using Tabular Statistics
        • Configure Counters to Display Caching Statistics
        • Configure Counters to Display Pub/Sub Statistics
        • Configure Counters to Display Lucene Statistics
        • Configure Counters to Display Bridge Statistics
        • Browse Cache Statistics
        • Monitor Bridge
      • Using Monitoring Dashboards
        • Configure Monitor Settings
        • Configure Event Logging
        • Configure API Logging
        • Monitor with a Built-In NCache Monitor Dashboard
        • Monitor with the NCache Monitor Custom Dashboard
        • Monitor Cluster Connectivity
        • Monitor Cache Clusters using NCache Email Alerts
    • Monitor Cache Using Command Line Tools
      • Monitor Cache Server Statistics with Command Line Tools
      • Monitor Cache Client Statistics with Command Line Tools
    • Monitor NCache Using Windows PerfMon Tool
      • Monitoring Cache Server Counters using PerfMon
      • Monitoring Cache Client Counters using PerfMon
      • Monitor Bridge Counters Using PerfMon Tool
    • Monitor NCache using Prometheus
    • Monitor NCache using Grafana
    • Monitor NCache Using SNMP Counters
    • Monitor NCache Using JMX Counters
    • Logging
      • NCache Log Viewer
      • Performance Counters Logging
      • Windows Event Logging
      • Cache Health Alerts
      • Email Notifications on NCache Events
      • Cache Server Logging
      • Client Side API Logging
      • Cache Event IDs
      • Feature Usage Logging
    • Troubleshooting NCache Monitoring
      • Computer Name Not Found
      • Diskperf Not Installed
      • No READ Access to Perflib Subkeys
      • Unable to Connect to Remote Server
    • IPV6 Support

Client Config (client.ncconf)

This client configuration file (client.ncconf) is used by the NCache client API to get the initial information required to establish a connection with the server. This file is universal for all client instances running on the client node. It is located at %NCHOME%\config in Windows or /opt/ncache/config in Linux. For modules that need to read the configurations, first they try to find the client.ncconf file in the application folder. If they do not find the client.ncconf in the application folder, they then read the configuration from the installation folder.

The client configuration file allows local and remote clients to connect to the caches. Moreover, remote clients also use this configuration file to connect to remote caches. This file automatically updates each time a new cache/cluster is created. Similarly, it updates every time new cache/cluster configuration settings are applied. However, this will only happen as long as NCache is installed on the machine and the NCache service is running.

Note

The same configurations can be specified via the CacheConnectionOptions API in the Alachisoft.NCache.Client SDK. For more details on how to use the API while initializing caches, please refer to the Connect to Cache page in the Programmers' Guide.

Important

The configurations specified through CacheConnectionOptions will override the configurations in the client.ncconf. Although, this is only true for the client that specifies them.

Client Config Syntax

The client configuration file is explained below.

<configuration>
  <ncache-server connection-retries="3" retry-connection-delay="0" retry-interval="1" load-balancer-connection-retries = "15" command-retries="3" command-retry-interval="0.1" client-request-timeout="90" connection-timeout="5" port="9800" local-server-ip="20.200.20.38" enable-keep-alive="False" keep-alive-interval="30" />
  <cache id="demoCache" client-cache-id="" client-cache-syncmode="optimistic" default-readthru-provider="" default-writethru-provider="" load-balance="False" enable-client-logs="False" log-level="error">
    <server name="20.200.20.38" is-load-balancer="True"/>
    <server name="20.200.20.23" is-load-balancer="True"/>
  </cache>
</configuration>

Understanding the Client Config Tags

The following section explains the tags mentioned as part of the file syntax.

<ncache-server>

This tag configures the connection settings between the client and NCache server and ensures communication.

<ncache-server connection-retries="3" retry-connection-delay="0" retry-interval="1" load-balancer-connection-retries = "15" command-retries="3" command-retry-interval="0.1" client-request-timeout="90" connection-timeout="5" port="9800" local-server-ip="20.200.20.38" enable-keep-alive="False" keep-alive-interval="30" />
  • connection-retries: Determines the number of retries the client makes on the whole list of servers mentioned in the client.ncconf file at the time when establishing a connection. It is the same if the connection breaks. By default, its value is 3.

  • retry-connection-delay: Specifies the time interval that the client API waits before going through another iteration of connection-retries. Delay is specified in seconds and the default value is 0 second.

  • retry-interval: If there is a disconnection and the client attempst to reconnect. This flag specifies the interval between each connection attempt. It is specified in seconds and the default value is 1 second. For instance, if the retry-interval is set to 3 seconds, then the client will wait 3 seconds before each retry atempt.

  • load-balancer-connection-retries: Specifies the number of attempts the load balancer makes to connect a client to the correct server for each connection retry. The defaut value is 15.

  • command-retries: Determines the number of times a command is executed after the connection between the client and the cache server is broken and re-established to ensure successful execution. By default, its value is 3.

  • command-retry-interval: Specifies the time gap between two successive command-retries. By default, it is 0.1 second.

  • client-request-timeout: Specifies the period for which the client API waits for a response for a command from the server. After this period is lapses an "OperationFailedException" is thrown. By default, this time period is 90 seconds and the minimum value is 60 seconds. If a time span is less than the minimum value it will automatically reset to the minimum value, i.e., 60 seconds.

  • connection-timeout: Determines the time period threads wait before throwing OperationFailedException during a connection-break, while one thread tries to establish a connection with the cache server. If the connection is successfully established, then all threads will complete their respective operations. Otherwise, they will throw an OperationFailedException. By default, it is 5 seconds.

  • port: Specifies the port that starts the NCache server and accepts connections from multiple clients. The default value of this port is 9800, which can be changed through the Service Configuration file.

  • local-server-ip: Specifies the IP address of the local server that runs a particular NCache Instance.

  • enable-keep-alive: Specifies whether the connection between the client and server should be kept "alive", i.e., if the client is inactive (not communicating with its connected servers), the client pings the server nodes after fixed intervals per the cache topology. This feature is particularly useful if there is a firewall that breaks idle network connections or if it detects disconnection proactively. By default, it is False.

  • keep-alive-interval: Determines the interval in seconds after which a heartbeat is sent from the idle client to the server to sustain the connection. The interval ranges between 1 and 7200 seconds with default set at 30 seconds. If any value is specified out of the range, NCache resorts to using the default value.

<cache>

This tag defines various settings for both remote and client caches.

<cache id="demoCache" client-cache-id="" client-cache-syncmode="optimistic" default-readthru-provider="" default-writethru-provider="" load-balance="False" enable-client-logs="False" log-level="error">
    <server name="20.200.20.38" is-load-balancer="True"/>
    <server name="20.200.20.23" is-load-balancer="True"/>
  </cache>
  • cache id: Specifies a unique ID to a remote cache.

  • client-cache-id: Specifies a unique ID to the client cache.

  • client-cache-syncmode: Defines the synchronization mode for the client cache. It can be Optimistic or Pessimistic. By default, it is optimistic.

  • skip-client-cache-if-unavailable: Defines whether cache operations are performed on the cluster cache in case of client cache unavailability. By default, it is True.

  • reconnect-client-cache-interval: Specifies the interval in seconds that the client node will wait to try connecting to the client cache again. By default, it is 10 seconds.

  • default-readthru-provider: Gets/Sets the ID of the default-readthru-provider. If the provider is specified through API, this value will be overwritten with the value passed from API.

  • default-writethru-provider: Gets/Sets the ID of the default-writethru-provider. If the provider is specified through API, this value will be overwritten with the value passed from API.

  • load-balance: When this flag is set, the client tries to connect to the optimum server in terms of the number of connected clients. This way an almost equal number of clients are connected to every node in the clustered cache and no single node is overburdened. By default, it is False.

  • enable-client-logs: When this flag is set to True, logs client activities for different purposes. By default, it is False as logging can create an overhead and degrade performance.

  • log-level: This flag helps to define the level of logging that you want to use. It can be set as Info, Debug, or Error as required. By default, it is set to error.

<server>

  • name: Specifies the IP addresses of the servers that run the NCache instance.

  • is-load-balancer: This flag ensures that the client connects to all the machines in the cluster. By default it is False.

Public IP Configuration

If you have subscribed to NCache Cloud and chosen the Public IP connectivity option, you will need to provide these public IP's in the server section of the client.ncconf. This is necessary despite the fact that the cache servers also have private IP's. However, these private IP's are only used within the cache cluster. This is a special situation because normally both the client.ncconf and the config.ncconf use private ips for cache servers.

Note

Please note that the server ips mentioned below are all public ips.

<!-- Please note that the server ips mentioned below are public ips and not private ips -->
<configuration>
  <ncache-server connection-retries="3" retry-connection-delay="0" retry-interval="1" command-retries="3" command-retry-interval="0.1" client-request-timeout="90" connection-timeout="5" port="9800"/>
  <cache id="demoCache" client-cache-id="" client-cache-syncmode="optimistic" default-readthru-provider="" default-writethru-provider="" load-balance="True"  enable-client-logs="False" log-level="error">
    <server name="44.241.59.205" />
    <server name="44.242.59.210" />
  </cache>
</configuration>

Port Forwarding Configuration

Note

If your cache servers and client applications are on the same subnet, you don't need to configure port forwarding.

If your cache servers and clients are on a different subnet or network, your client application might not be able to access your cache servers directly on the basis of IP addresses. In this case, you'll have to configure port forwarding and modify your client.ncconf file accordingly.

Client Config Syntax for Port Forwarding

The client configuration file for port forwarding is explained below.

<configuration>.
...
<server-end-point>
      <end-point public-ip="172.19.0.11" public-ports="9801" private-ip="20.200.20.38" private-ports="9800"/>
      <end-point public-ip="172.19.0.11" public-ports="1250-1260" private-ip="20.200.20.38" private-ports="8250-8260"/>
      <end-point public-ip="172.19.0.11" public-ports="1300-1400" private-ip="20.200.20.38" private-ports="8300-8400"/>
      <end-point public-ip="172.19.0.11" public-ports="9802" private-ip="20.200.20.23" private-ports="9800"/>
      <end-point public-ip="172.19.0.11" public-ports="2250-2260" private-ip="20.200.20.23" private-ports="8250-8260"/>
      <end-point public-ip="172.19.0.11" public-ports="2300-2400" private-ip="20.200.20.23" private-ports="8300-8400"/>
    </server-end-point>
</configuration>

Understanding the Client Config Tags for Port Forwarding

The following section explains the tags mentioned as part of the file syntax.

<server-end-point>

These represent the endpoints that will be used to communicate with the NCache servers. The following is a sample client.ncconf file with port forwarding configured.

  • end-point: Specifies the end-point of the ncache server. A combination of an IP address and port.

  • public-ip: Specifies address that is publicly accessible or present outside of the local network.

  • public-ports: Specifies the publicports that will be used to access the private ports.

  • private-ip: Specifies address that is present within the local network and is not directly accessible. This is the IP address that is used by the NCache server.

  • private-ports: These are the ports that are not directly accessible. These are the ports used by the NCache server.

See Also

EF Caching Config
Server-side Configurations
Cache Server Settings
General Cache Settings

In This Article
  • Client Config Syntax
  • Understanding the Client Config Tags
    • <ncache-server>
    • <cache>
    • <server>
  • Public IP Configuration
  • Port Forwarding Configuration
    • Client Config Syntax for Port Forwarding
    • Understanding the Client Config Tags for Port Forwarding
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top