Is Citrix ADC smart enough to know when my site has gone into local host cache (LHC) mode? Does it know that my site only has a single delivery controller running that can respond to Citrix StoreFront XML requests? If it doesn’t know, then the StoreFront XML request will break, resulting in application enumeration failure where users will see an empty list of applications. In this blog post, I’ll answer these questions as I cover load balancing XML services and how XML traffic is managed when a site is in LHC mode.
Today, it’s rare for our Citrix Consulting Services customers not to use a device to load balance the XML services on their delivery controllers. Citrix StoreFront does have the ability to load balance natively — just check the “Servers are load balanced” option when adding a list of your site’s delivery controllers for StoreFront to manage. But we recommend using Citrix ADC to load balance XML services for better performance at scale.
LHC Mode 101
Starting with XenApp and XenDesktop 7.12, a Citrix Virtual Apps and Desktops site goes into LHC mode when the deliver controllers’ communication to the SQL database fails. The site still functions, albeit with some limitations. Each controller communicates with the database every 20 seconds. If the database cannot be contacted for more than 90 seconds, LHC mode is triggered.
When a Citrix Virtual Apps and Desktops site is in LHC mode, there’s only a single functional delivery controller per zone. Controllers are elected in alphabetical order per zone. When an outage occurs, all VDAs need to re-register with an active controller.
But what happens to XML traffic?
StoreFront Native XML Load Balancing During LHC Mode
If Citrix StoreFront is load balancing XML requests natively, it will become aware that all but the elected deliver controller is down when the site is in LHC mode. During such an outage, the XML service on all secondary controllers stop and fail StoreFront’s background health check. Event ID 4010 will be logged in the Citrix Delivery Services log on the StoreFront servers to indicate this, as shown below, and StoreFront will only communicate with the elected controller.
Citrix ADC Intelligent XML Load Balancing During LHC Mode
How do things change if we have an LB VIP for the controllers and StoreFront lists only the LB VIP DNS name in its list of sites to manage? In this case with a single zone, when the site goes into LHC mode, the LB VIP will see all the controllers as down except the elected controller. All XML requests will be sent to the elected Controller via the LB VIP.
The screenshot below shows only the elected controller in an UP Service State. All other controllers are DOWN.
How does Citrix ADC do this? We use Citrix ADC’s built-in monitors for delivery controllers. There are two main monitors used for load balancing XML traffic: citrix-xml-service and citrix-xd-ddc. The citrix-xml-service monitor is only applicable to 6.x environments and shouldn’t be used with later versions of Citrix Virtual Apps and Desktops.
Use the citrix-xd-ddc service monitor for 7.x environments. To verify complete controller health, this monitor queries the controllers, requesting farm data such as site name and will only mark the service as UP if it receives a healthy response. HTTP 200 indicates a successful response, as we see below.
It also can be configured to verify user credentials, providing an extra level of validation that the service is healthy and working as expected. When configuring the monitor, enable the Validate Credentials option within the Special Parameters tab and provide a service account’s username and password, as seen below.
Under the hood, this monitor will submit the configured user’s credentials and expects back a successful response to indicate service health, as seen below.
In both of these cases, during LHC mode, the elected controller will return a successful response as seen above, indicating service health. The non-elected controllers return a 503 Service Unavailable error, as seen below, and Citrix ADC will mark these servers as DOWN.
StoreFront’s native load balancing also verifies service health by querying the controllers. But the check is not as thorough because it does not verify farm data (like site name) or validate credentials. Similar to the Citrix ADC health checks, the elected controller during a database outage will respond with a 200 OK, as seen below.
The non-elected controllers, on the other hand, will return the 503 error shown below.
I Have Multiple Zones. Do I Need Multiple Load Balancing vServers?
What if I have multiple zones within my site? A single LB VIP that contains all the controllers in every zone may be sufficient if all of the zones are within the same data center (such as a large site divided into multiple zones). During LHC mode, elected controllers in every zone are in an UP Service State and are available to service StoreFront’s XML requests. The single LB VIP allows for any one of the elected controllers in any of the zones to fulfill that request.
However, we recommend defining multiple LB VIPs, such as a separate LB VIP per zone. This is especially applicable when each zone represents a distinct location where ADC devices are deployed. An LB VIP per zone contains all the controllers within that zone, because any controller within a zone can be elected. With multiple LB VIPs, you should configure StoreFront with all VIPs in failover order, with the “local” VIP first in the list.
When an outage occurs, one controller per zone will be active. The LB VIP will only send traffic to that one elected controller and see the other controllers in its services list as unavailable. The screenshot below shows two zones within the site, along with each zone’s respective controllers.
The screenshot below shows the elected controllers in an UP Service State per zone during an outage.
In Summary
So is Citrix ADC smart enough to know when my site has gone into LHC mode?
Yes!
Citrix ADC load balancing vServers — when configured with the recommended XenDesktop delivery controller service monitor — are indeed intelligent enough to know when a site has entered LHC mode and will only communicate with a single elected controller. The LB VIP knows the site only has a single elected controller that is able to respond to StoreFront XML requests.
I hope I’ve helped you to understand the impact of a site in LHC mode on Citrix ADC XML load balancing, as well as the value of using the intelligent monitors to verify XML service health during normal operations.
Many thanks to Michael Havens, Enterprise Architect, for assisting with this blog post.
Citrix Tech Bytes – Created by Citrix Experts, made for Citrix Technologists! Learn from passionate Citrix Experts and gain technical insights into the latest Citrix Technologies.
Click here for more Tech Bytes and subscribe.
Want specific Tech Bytes? Let us know! tech-content-feedback@citrix.com.