• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
Download
Show / Hide Table of Contents

Cache Memory

This page discusses different cache memory configuration options available in NCache, along with the scenarios in which they should be used and the reasons for their implementation.

Buffer size

The Buffer Size of the client socket can be specified in the service config file. SendBufferSize specifies the size of the buffer (in bytes) the connected client socket uses for outgoing data.

<add key="NCacheServer.SendBufferSize"/>

ReceiveBufferSize specifies the size of the buffer (in bytes) the connected client socket uses for incoming data.

 <add key="NCacheServer.ReceiveBufferSize"/>

LOH (Large Object Heap) Size

A buffer with a size greater than 80 Kb is created on the Large Object Heap (LOH). Garbage Collector does not 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 512 Kb.

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

Cache Size Threshold

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 specifies the time interval (in minutes) during which a warning for the cache size exceeding the defined threshold is issued only once. If cache size drops below the defined threshold due to eviction and then exceeds it again within this interval, no additional warning is thrown. The minimum allowable value is 5 minutes, and the default value for this interval is 15 minutes.

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

Enumeration

Enumeration in NCache is designed to allow cache data to be browsed without locking the cache itself. 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:

Snapshot Pooling by Cache Size

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 limit is reached. Once the threshold value is crossed, the cache creates a pool of snapshots that holds those snapshots based on time slicing. These snapshots are provided to the enumerator on demand from the client by the cache server. The default size is 100,000 items in cache and the minimum is 1.

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

Snapshot Pool Capacity

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 does not allow more snapshots to be added to the pool. It will wait until an existing snapshot in the pool is removed. The default size is 10 snapshots in the cache snapshot pool and the minimum is 1.

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

Snapshot Creation Interval

The NCacheServer.SnapshotCreationThreshold can be used to specify after how many seconds a new snapshot is 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 time gets a new snapshot from the pool. The default size is 30 seconds and the minimum is 1 second.

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

Enumerator Chunk Size

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 and the minimum is 1.

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

Garbage Collection Frequency

The ServiceGCCollectionInterval parameter is defined in minutes and has a default value of 180. The minimum value should be chosen carefully to ensure that it is both meaningful and efficient. Since garbage collection is a resource-intensive operation that can impact application performance, users are advised to set this value based on the memory footprint of their application. Although garbage collection is automatically managed by the CLR according to the system state, invoking it forcefully incurs additional overhead and should be avoided unless necessary.

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

Enable Object Pooling

The EnableObjectPooling specifies whether object pooling is enabled on the NCache server. When set to True, NCache will use a pool of reusable objects which will reduce the load on Garbage Collector (GC) and improve overall server performance.

<add key="NCacheServer.EnableObjectPooling" value="True"/>
Note

Enabling MMapDirectory can improve I/O performance but consumes significant virtual address space on the server. Before enabling this option, make sure there is sufficient virtual address space available on the system.

See Also

Configure Caches
Cache Settings
Client Connectivity Settings
Windows Events

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Community
  • 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 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top