• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
  • Cache Server Settings
  • Memory
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

Cache Memory

This page discusses different cache memory configuration options available in NCache (such as Buffer size, LOH (Large Object Heap) Size, Windows Events Logging, Response Data Size, and more) along with when they should be implmented and why.

Configure Cache Memory Settings

Following are some cache memory configuration settings including the Buffer Size, LOH (Large Object Heap) Size, and other configurations.

Buffer size

The Buffer Size of the client socket can be specified in the service config. SendBufferSize will specify the send buffer size of the connected client socket, in bytes.

<add key="NCacheServer.SendBufferSize" value="131072"/>

ReceiveBufferSize will specify the receive buffer size of the connected client socket, in bytes.

 <add key="NCacheServer.ReceiveBufferSize" value="131072"/>

LOH (Large Object Heap) Size

A buffer with a size greater than 80Kb is created on the Large Object Heap(LOH). Garbage Collector doesn't compact the large heap for better performance. Therefore, NCache uses a pool for large buffers. NCache reserves two buffers per client. These buffers are allocated through the LOH buffer pool. The LOHPoolSize refers to the initial size of the pool, i.e., how many buffers are allocated initially. LOH pool can increase its size by LOHPoolSize on demand.

<add key="NCacheServer.LOHPoolSize" value="40"/>

LOHPoolBufferSize is the size of an individual buffer allocated by the LOH Pool. The default buffer size is 512Kb.

<add key="NCacheServer.LOHPoolBufferSize" value="512"/>

Configure Windows Events Logging

CacheSizeThreshold is the size of the cache in percentage of the total cache size. When this threshold is reached, a warning message is logged into the system event log. No warning message is logged if the following line is commented.

<add key="NCacheServer.CacheSizeThreshold" value="80"/>

The CacheSizeReportInterval is the interval in minutes, during which the CacheSizeThreshold warning is issued once. If cache size falls below the CacheSizeThreshold due to eviction and again crosses the CacheSizeThreshold limit during this interval, no warning is generated. The minimum value is 5 minutes.

<add key="NCacheServer.CacheSizeReportInterval" value="15"/>

Configure Response Data Size

NCache introduces Response Data Size to limit the large result sets returned in response to bulk Search, Tags, and Group operations. The .NET framework does not support the serialization of large result sets which exceed the size of 1.9 GB. To solve this problem, NCache splits the large result sets into smaller chunks of data.

The NCacheServer.ResponseDataSize can be used to specify the size of a response. It will help in limiting a response size by dividing the bigger response into multiple responses each containing the data approximately equal to the specified limit. These multiple responses will be merged by the NCache client as a single response. Here, it takes value in MBs. The default size is 1024 MB.

<add key="NCacheServer.ResponseDataSize" value="1024"/>

Configure Enumeration

The purpose of introducing Enumeration is to keep the cache free from locking while enumerating the cache data. This process eventually increases the cache performance and its availability for clients. NCache follows the technique of taking snapshots of cache data and sending it to the client for Enumeration which keeps the cache free from being locked during the process of Enumeration. Four attributes are defined for Enumeration, which are:

The NCacheServer.SnapshotPoolingCacheSize can be used to specify the size of the cache (in terms of the number of items) for enabling Enumeration on the cache. It will help in deciding whether to create a pool of snapshots for Enumeration or not. A complete snapshot of the cache is returned to the enumerator until the threshold reaches its limit. Once the threshold value is crossed, the cache will create a pool of snapshots that will hold those snapshots based on time slicing. These snapshots will be provided to the enumerator on demand from the client by the cache server. The default size is 100,000 items in cache.

<add key="NCacheServer.EnableSnapshotPoolingCacheSize" value="100000"/>

NCacheServer.SnapshotPoolSize can be used to specify the number of snapshots allowed in the pool for Enumeration. Once the pool reaches its maximum limit, it won’t allow more snapshots to be added to the pool. It will wait till any existing snapshot in the pool has been removed. The default size is 10 snapshots in the cache snapshot pool.

<add key="NCacheServer.SnapshotPoolSize" value="10"/>

The NCacheServer.SnapshotCreationThreshold can be used to specify after how many seconds a new snapshot will be added to the pool for Enumeration purposes. The same cache snapshot from the pool is provided to all enumerators on the cache until the threshold time has elapsed. Any enumerator that requests a snapshot after that will get a new snapshot from the pool. The default size is 30 seconds.

<add key="NCacheServer.SnapshotCreationThreshold" value="30"/>

The NCacheServer.EnumeratorChunkSize can be used to specify the chunk size for Enumeration. Chunk size is the number of cache items returned to the enumerator from the cache server. Once the enumerator is done enumerating through a chunk of data, it will get the next chunk from the cache server for Enumeration. The default size is 1000 items returned in each chunk.

<add key="NCacheServer.EnumeratorChunkSize" value="1000"/>

Value of seconds after which service should check if it needs to do a Forced Garbage Collection. This property dictates how frequently you want to check if a Forced Garbage Collection is required or not. The default value is 20 seconds. The minimum possible value is 5 seconds. NCacheServer.ServiceGCCollectionInterval can be used for limiting the GC collection on a specified interval. This value is in minutes. GC collection can be stopped by providing a value of 0.

<add key="NCacheServer.ServiceGCCollectionInterval" value="180"/>
<add key="NCacheServer.StateTransferDataSizePerThread" value="5"/>

For Mirror and Partition-Replica Cache Topologies, items are asynchronously replicated to the backup nodes in bulk. This is the number of items in one bulk sent to the backup node in a single async call.

<add key="NCacheServer.BulkItemsToReplicate" value="50"/>

See Also

Configure Caches
Cache Settings
Server Connectivity
Windows Events

In This Article
  • Configure Cache Memory Settings
    • Buffer size
    • LOH (Large Object Heap) Size
  • Configure Windows Events Logging
    • Configure Response Data Size
    • Configure Enumeration
  • 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