Back to: ASP.NET Core Web API Tutorials
How to Download and Install NCache in Windows
In this article, I will discuss How to Download and Install NCache in Windows. Please read our previous articles discussing NCache Cluster and Its Types in Distributed Caching. NCache is a high-performance, distributed caching system that is widely used in .NET applications to improve application performance by reducing database load. To download and install NCache on a Windows 10/11 system, you can follow the following step-by-step instructions:
Step 1: Download NCache
- Visit the Official Website: Go to the official Alachisoft NCache website at alachisoft.com.
- Choose the Edition: Navigate to the download section and choose the version of NCache suitable for your needs (e.g., Professional, Enterprise, or Open Source).
- Download the Installer: Fill out the form if necessary and download the installer.
So, first, visit the following website:
https://www.alachisoft.com/download-ncache.html
Once you visit the above website, it will open the page below. On this page, please click on the NCache Enterprise (.NET 6) (.msi) (Windows) link, as shown in the image below. This version is required if you want to integrate NCache from your .NET Core Application.
Once you click on the above link, it will open the below page. Provide the necessary details and click on the Register and Download button as shown in the below image. It will send the License key to provide an Email Address. Here, you need to provide your Company Email Address. Gmail and Yahoo Email Addresses will not work.
Once you click on the Register & Download button, the License Agreement Page will open. Click on the I Accept the License Agreement button as shown in the below image:
Once you click Accept the License Agreement by clicking the above link, the following page will open. Here, you need to click on the Download button to download NCache on your machine, as shown in the image below:
Once you click on the Download button, it will download the NCache Windows Installed as shown in the below image with the download provided path:
You will also get one Email Containing the License Key, as shown in the below image:
Step 2: Install NCache on the Windows Operating System
- Run the Installer: Once the download is complete, locate the downloaded installer file (usually a .msi file) and double-click it to start the installation process.
- Follow the Installation Wizard: The installer will guide you through the installation process. Accept the license agreement and select the installation directory.
- Configure Installation Preferences: You can customize your installation preferences, such as which components to install. For most users, the default options are sufficient.
- Complete the Installation: Follow the prompts to complete the installation. This may include configuring network settings if you are setting up a distributed cache.
NCache Installation Process Step by Step:
We need to install the NCache using Command Prompt in Administrator mode. Search for Command Prompt on the Windows Start menu. Right-click on the “Command Prompt” and select Run as Administrator, as shown in the image below. This is because NCache must be installed from an “admin” user.
Once you open the command prompt in Administrator mode, run the msiexec.exe /I “D:\NCache\ncache.ent.net.x64.msi” command from Command Prompt to install NCache in an interactive mode as shown in the below image. Here, I have put the ncache.oss.x64.msi file in the D:\NCache directory.
Once you click the enter button, the following Welcome to the NCache Installation Wizard screen appears, and to start installing, click on the Next button as shown in the below image:
Once you click on the Next button, the License Agreement screen will open. Please accept the License and click on the Next button as shown in the below image. By clicking, I accept the terms in the License Agreement, and you are making a legal commitment to abide by the Alachisoft Software Evaluation Agreement for NCache. You cannot proceed without accepting the license agreement.
Once you click on the Next button, the Installation Type window will open. Here, please select the type as Cache server and click on the Next button as shown in the below image:
Once you click on the Next button, the Installation Key window will open. You must get one email with the License Key. Just enter the License Key and click on the Next button as shown in the below image:
If you do not have the Installation Key, click Get Evaluation Key. The registration page from the Alachisoft website is displayed. Enter all the required information and press Register or Login. An Install Key is emailed to you. Then, enter that Install Key in the above dialog.
Once you click on the Next button, the User Information dialog window will open, asking for your information. Please provide your information and click on the Next button, as shown in the image below.
Once you click on the Next button, the Select Installation Folder window will open. Here, you need to select the location where NCache should be installed. You can keep the defaults or change them and then click on the Next button, as shown in the image below. I am going with the default location.
Once you click on the Next button, it will open the following Configure IP Binding and Firewall Ports window. From the dropdown menu, select the IP address to which you want to bind NCache services. By default, the firewall configures for all ports used by NCache. Then click on the Next button as shown in the below image:
Once you click the Next button, the Set Account to Run NCache Services window will open. This dialog box is only for ASP.NET Core installation.
This screen asks for user credentials with administrative privileges required to monitor PerfMon counters in case of ASP.NET Core installation. Enter the account name and password, or use a local system account. I am using a local system account and then click on the Next button as shown in the below image:
By default, the NCache Service will create and start a demo cache named demoCache of topology Partition-Replica at the end of setup installation. You can disable this option from this screen by unchecking the “Start demo cache at the end of the process” option. So click on the Install button to start installing.
After the installation is successful, the following screen is displayed. On this screen, there is an option to Launch the NCache Management Center, which automatically launches the NCache Management Center on your local host after a successful setup installation. You also have the option to choose to Launch the Getting Started Guide. After you have made your choice, click on the Finish button, as shown in the image below.
Once you click on the Finish button, then it will launch the web browser and open the following page (http://localhost:8251/ClusteredCaches):
NCache Installation Options
When setting up NCache in your environment, it’s important to select the right installation type based on your particular requirements. NCache offers three different installation options, the following sections details these.
Cache Server
- Purpose: This is the core role of NCache. The Cache Server installation sets up the machine to host a cache. It includes all the necessary components and services required for the cache server to operate, manage, and store data.
- Usage: Cache servers are typically installed on dedicated server machines. These servers are part of a cluster that collectively forms the distributed cache architecture. Each server in the cluster can handle requests for cache data, and they work together to ensure data is evenly distributed and redundantly stored for high availability and performance.
- Configuration: Installing as a Cache Server often requires configuring network settings, cache topologies, and synchronization settings among multiple cache servers. It may also involve setting up security features and backup mechanisms.
Developer/QA
- Purpose: This installation option is tailored for development and testing environments rather than production. It typically includes tools and libraries necessary for integrating NCache into your applications and for testing the caching strategies and implementation.
- Usage: Developers and QA engineers install this role on their local machines or on dedicated development/test servers. It allows them to work with and test against an NCache environment without needing to interact with the actual production cache servers.
- Configuration: This role might include advanced debugging and testing tools. It allows for configurations that mimic the production environment or simulate various test scenarios. It’s crucial to ensure that applications handle caching as expected before going live.
Remote Client (Optional)
- Purpose: The Remote Client installation is designed for situations where application servers or other client machines need to interact with the cache server without hosting a part of the cache themselves.
- Usage: This role is suitable for application servers or client applications that are configured to use the cache but are not part of the cache cluster. These clients connect to the cache servers over the network to request and retrieve cached data.
- Configuration: Remote Clients require configuration to ensure they can locate and authenticate to the cache servers. This setup often involves security configurations to protect data in transit and to authenticate clients against the cache servers securely.
https://cloudcoders.xyz/blog/caching-with-ncache-in-asp-net-core/
Using the NCache Management Center
Launch the NCache Management Center by browsing to http://localhost:8251 or <server-ip>:8251 on Windows and Linux.
In the left navigation bar, click on Clustered Caches. This opens the Clustered Caches page at <server-ip>:8251/ClusteredCaches/. The page shows any existing clustered caches on your machine and additional details like Topology, Servers, and Server Platform, as shown in the image below. To create a new distributed cache, click on New.
It will open the following page. From the In-Memory Store Type dropdown menu, select Distributed Cache and specify the name of your cache. Select JSON or Binary from the Serialization dropdown menu as per your requirement. I am giving the cache name MyClusteredCache1 and selecting the JSON Serialization. Then, click on the Next button, as shown in the image below.
Note: If a cache with the specified name already exists, you are prompted with an error message. If you are using ASP.NET 5.0 and above, use JSON serialization as a recommended approach.
Then, it will open the Caching Topology. Here, you need to select the caching topology and any advanced options like Operation Timeout and Statistic Replication Interval. I have selected the Replicated Cache and then clicked on the Next button, as shown in the image below.
From the next screen, specify the Maximum Size of the cache, if required. You can add cache nodes to the cluster by specifying the node IP address and clicking the Add Node button. To add more nodes, click Add Node. Once all the required nodes are added, click Next.
Next, change the Cluster Port and Port Range if required. If necessary, check the Enable Pipelining checkbox to enable pipelining for the cache. Set the Batch Interval in microseconds for the duration after which the commands will be transmitted over the network. Click Next.
If you want to enable encryption and compression, check the Enable Encryption and Enable Compression checkboxes. If enabled, set the Provider and Key for encryption and Threshold Size for compression. Click Next.
On Advanced Options page, you can configure the following settings:
- Eviction is enabled by default. You can configure the Eviction Policy accordingly. If you want to disable eviction, uncheck the check box Enable Eviction.
- You can also change the Eviction percentage; if eviction is enabled, items will be evicted from the cache using this percentage value.
- You can change the Clean interval value. The default is 15 seconds.
- If you have checked the Start this cache on Finish checkbox in this dialog box, it will start automatically upon the completion of this process.
- Checking the checkbox Auto start this cache on service startup will make the cache start automatically after the service restarts.
Click Finish. The created cache will appear on the Clustered Caches page with the server nodes and their status. A success notification will be received in the notification panel.
You can check whether the newly created cluster is working or not by using Test-Stress. To do so, open the Windows PowerShell, type the command Test-Stress MyClusteredCache1, and then press the enter button as shown in the below image:
In the next article, I will discuss How to Implement NCache in ASP.NET Core Web API Application with Examples. In this article, I explain How to Download and Install NCache in Windows Operating Systems. I hope you enjoy this article, How to Download and Install NCache in Windows Operating Systems.