What is LHC (Local Host Cache)?

What is LHC?

The IMA service running on each Presentation Server downloads the information it needs from the central data store into a local MDB database called the local host cache, or “LHC.” (The location of the local host cache is specified via a DSN referenced in the registry of the Presentation Server, at HKLM\SOFTWARE\Citrix\IMA\LHCDatasource\DataSourceName. By default this is a file called “Imalhc.dsn” and is stored in the same place as MF20.dsn.)
Each Presentation Server is smart enough to only download information from the data store that is relevant to it, meaning that the local host cache is unique for every server. Citrix created the local host cache for two reasons:

1. Permits a server to function in the absence of datastore connectivity.
2. Improves performance by caching information used by ICA Clients for enumeration and application resolution.

The LHC is an Access database (Imalhc.mdb) stored default in the path  “<ProgramFiles>\Citrix\Independent Management Architecture” folder.
LHC contained the following information:

1. All servers in the farm, and their basic information.
2. All applications published within the farm and their properties.
3. All Windows network domain trust relationships within the farm.
4. All information specific to itself. (product code, SNMP settings, licensing information)

The LHC is critical in a CPS environment. In fact, it’s the exclusive interface of the data store to the local server. The local server’s IMA service only interacts with the LHC. It never contacts the central data store except when it’s updating the LHC. If the server loses its connection to the central data store, there’s no limit to how long it will continue to function. (In MetaFrame XP, this is limited to 48 or 96 hours, but that was because the data store also store license information.) But today, the server can run forever from the LHC and won’t even skip a beat if the central connection is lost. In fact now you can even reboot the server when the central data store is down, and the IMA service will start from the LHC with out any problem. (Older versions of MetaFrame required a registry modification to start the IMA service from the LHC).

The LHC file is always in use when IMA service is running, so it’s not possible to delete it or anything. In theory it’s possible that this file could become corrupted, and if this happens I guess all sorts of weird things could happen to your server. If you think this is the case in your environment, you can stop the IMA service and run the command “dsmaint recreatelhc” to recreate the local host cache file, although honestly I don’t think this fixes anything very often. Local Host Cache is synchronised with the Data Store by the Zone Data Collector for every 30 minutes and it can also be configured through registry.

How to Refresh the Local Host Cache?
If the IMA service is currently running but published applications do not appear correctly in ICA Client application browsing, force a manual refresh of the local host cache by executing dsmaint refreshlhc from a command prompt on the affected server. This action forces the local host cache to read all changes immediately from the data store.
A discrepancy in the local host cache occurs only if the IMA service on a server misses a change event and is not synchronized correctly with the data store.

Posted in Citrix XenApp | Tagged , , , , , | Leave a comment

What is a Farm and Zone in Citrix?

A Farm is a group of Citrix servers which provides published applications to all users that can be managed as a unit, enabling the administrator to configure features and settings for the entire farm rather than configuring each server individually. All the servers in the farm share a single data store.
A server farm is a grouping of servers running Citrix Presentation Server that can be manage as a unit, similar in principle to a network domain. When designing server farms, keep in mind the goal of providing users with the fastest possible application access while achieving the degree of centralized administration and network security that you need.

Zone is subset of Farm. It is a grouping of Presentation Servers that shares the common Data Collector. Zones are very helpful in controlling traffics. It collects data from member servers and distributes changes to all servers in the farm. A zone in the Presentation Server farm elects a zone data collector for the zone and it is responsible to communicates between other ZDCs in the farm. It is used to redirect the users to least busy server. The ZDC maintains all load and session information for every server in the zone. ZDCs keep open connections to other ZDCs changes in the member servers of a zone and are immediately propagated to the other ZDCs in the farm. Zone has server members and one of them is ZDC (Zone Data Collectors) in each zone. These ZDCs communicate between zones. Zones are very help full in controlling traffic. We can move the servers among the zones and after moving the servers from one Zone to another the servers must be restarted to get settings and configurations from the Data Store.

Posted in Citrix XenApp | Tagged , , , , , | Leave a comment

What is a Data Store and Zone Data Collector?

This is the place where all the static information are stored. The Data Store provides a repository of persistent information about the farm (Farm configuration information, Published Application configurations, Server configurations, Static policy configuration, XenApp administrator accounts, and Printer configurations) that all servers can refer.
The data store is the central repository where almost the entire Citrix implementation is invested. The Administrators of the farm, the license server to point to, the whole farm configuration, the published applications, all their properties, the security of who gets access to what, the custom load evaluators, custom policies, configured printers and print drivers, all this is stored in the central repository called the Data Store.

Data Collector stores all the dynamic information like session, load and published applications in the servers in their zones and communicates the zone information to the Data Collectors in other zones in the farm.
Data collector is a Citrix Presentation Server whose IMA service takes on the additional role of tracking all of the dynamic information of other Presentation Servers. This information is stored in memory and called the “dynamic store”.

The data store is a database on disk. The dynamic store is information stored in memory.
To look the contents of the in-memory dynamic store on the data collector, use “queryds” command. QueryDS can be found in the “support\debug” folder of your Presentation Server installation source files.
To determine which server is acting as the data collector in the zone run “query farm /zone” from the command line

Posted in Citrix XenApp | Tagged , , , , , | Leave a comment

IMA Startup error due to Data Store

The IMA service running is necessary for the discovery of the XenApp server, XenApp functionality and for normal operability of XenApp. In the registry, you can see the CurrentlyLoadingPlugin string to identify if the issue is related to the datastore.

Check if the IMA service is started. If not started see the error message that may help to find the root cause.

Use the registry editor and look at the following registry string:
\HKLM\SOFTWARE\Citrix\IMA\Runtime\CurrentlyLoadingPlugin. In 64-bit \HKLM\SOFTWARE\Wow6432Node\Citrix\IMA\Runtime\CurrentlyLoadingPlugin.
If the IMA service fails to start and this value is blank or not present, the IMA service could not connect to the datastore or the local host cache is missing or corrupted.

Procedure 1
Check the database connectivity and authentication by using the Windows ODBC Configuration. Select the System DSN Data Source and click Add to add a new datasource. If we get connection failed error message then the database authentication and db_owner roles needed to be set on the database in the SQL server. Address the connectivity issue and attempt to restart the IMA service.
Procedure 2
Run the XenApp Role manager in XenApp 6.0 to reconfigure your XenApp Configuration. Select Edit Configuration in the XenApp selection. Click Create new server farm or Join an existing server farm. Creating a new database and Farm will rule identify existing farm as problematic. Join an existing working farm if you have a working farm but better create a new farm to address the issue. When the server farm was recreated and configured, the IMA service started and the appropriate registry entries were present

If there is no connectivity between the SQL server and the Local Host Cache, we need to configure it once again to establish the connection to work again normally.

1. Run the below command:

dsmaint config /user:username /pwd:password /dsn:dsnfilename

2. Stop the IMA service

3. Recreate LHC. dsmaint recreatelhc

4. Start the IMA service.

 

Posted in Citrix XenApp | Tagged , | Leave a comment

Load Evaluators included in XenApp

Default: After adding license to the server farm, the Default load evaluator is attached to each server in the farm.It contains two rules: Server User, which reports a full load when 100 users log on to the attached server and Load Throttling, which specifies the impact of logging on users to the server and limits the number of concurrent connection attempts the server is expected to handle
Load Throttling
Limits the number of concurrent connection attempts that a server handles. This prevents the server from failing when many users try to connect to it simultaneously.
The default setting (High impact) assumes that logons affect server load significantly. This rule affects only the initial logon period, not the main part of a session.
The Load Throttling rule can be applied only to a server, not to an individual application.

Advanced: This load evaluator contains the CPU Utilization, Memory Usage, Page Swaps, and Load Throttling rules.
We cannot delete the Citrix-provided Advanced or Default load evaluators and can create new load evaluators based on the rules available. Each server or published application can have only one load evaluator attached to it.

qfarm /load command displays the load for all servers in the farm

The qfarm /app command displays the load for all applications and servers in the farm. The load, 99999 means there is no load evaluator assigned to the application.

Posted in Citrix XenApp | Tagged , , | Leave a comment