|Number of votes:||6|
In an enterprise setup of EPiServer CMS 5 with load balancing, the system must continuously update page information between all the Web sites. In the Enterprise Edition of EPiServer CMS 5, this is done using intelligent cache updates. In this article you will be guided through the configuration steps needed to set up the load balancing.
A feature that the Enterprise Edition has introduced is intelligent cache updates. From a .NET viewpoint, all your enterprise Web sites are completely separate applications, running in their own appDomains. Since all sites share the same database and may be affected by page updates on other sites, the system needs to be able to update page information between all the enterprise Web sites.
As from EPiServer CMS 5 R1, the cache update between sites, regardless of whether they are running on the same machine or not, is done via UDP network traffic. The only configuration that is needed is to make sure that enableEvents and enableRemoteEvents are both set to “true”. When a site starts, it registers its siteId in the database (if it's not already there). It then reads all siteId's back from the database and registers an interest in receiving cache notifications for each one.
If the cache update mechanism does not appear to work, the cause is most likely that you have network devices between your servers that prevent UDP broadcasts from being relayed. Software-based firewalls (i.e. the Windows Firewall) may also need to be configured to allow the UDP traffic to reach the machine. Find out more below.
The first thing to do is to test the network for UDP communication. This is done with a listening/broadcasting tool, for instance the EPiServerRemoteEventsListener or Test TCP. Make sure that you test the UDP connection at least two times with the test tool and not just once. This is to ensure that the connection is really working.
EPiServerRemoteEventsListener is a diagnostics application for the EPiServer CMS 5 Events System. EPiServer CMS 5 uses Windows Communication Foundation technology to send events between a load balanced site.
The EPiServerRemoteEventsListener application listens on the same UDP channel as EPiServer CMS in order to display the events that are being transmitted by EPiServer CMS, both on the local machine and by other machines on the same network. This can be useful to determine if firewalls or other software are blocking the EPiServer CMS events.
The current version of the diagnostic application can be used both to send and receive events. The application requires .NET 2.0 and can be found at http://world.episerver.com/en/Download/Categories/Download-Type/Code-Samples1/File-System/Listening-to-EPiServer-File-Events/. The application is installed using a simple XCopy of the contents of the zip file.
Another tool that can be used to see if a route is open for TCP/UDP traffic is Test TCP (ttcp.exe). This ships with Windows Server 2003 in the ValueAdd folder. Please refer to http://technet.microsoft.com/en-us/library/bb877965.aspx for more details.
On one server you configure the tool to send a message out over the network and on all the other servers you run the tool as is (listening):
After sending a message it will automatically show up on the servers listening. If it does not, contact the network people that configured the server and make sure the network supports UDP broadcasting on at least one port.
In the <site> section in web.config, ensure that the <siteId> values are all the same on each of the servers.
In the <siteSettings> section in web.config, ensure that the following values are set as shown:
<siteSettings enableEvents="true" enableRemoteEvents="true">
If enableEvents is set to “true” but enableRemoteEvents is set to “false”, then any events raised will only be distributed to subscribers within the same site. For load balanced or enterprise sites, enableRemoteEvents must also be set to “true” so that the events can be distributed to other sites both on the same server and on other servers.
In the <httpModules> section in web.config, ensure the <add> element for the EventSubscriberHostModule is not commented out:
<add name="EventSubscriberHostModule" type="EPiServer.EventSubscriberHostModule, EPiServer" />
In the <configuration> section in web.config, ensure the following <system.serviceModel> section exists and is not commented out. NOTE that if a special port was opened for the UDP broadcast, then this port must be configured in the <endpoint’s as shown below.
<add name="udpTransport" type="Microsoft.ServiceModel.Samples.UdpTransportElement, EPiServer.Implementation" />
<!-- Before deployment, you should remove the returnFaults behavior configuration to avoid disclosing information in exception messages -->
<service name="EPiServer.Events.Remote.EventReplication" behaviorConfiguration="DebugServiceBehaviour">
<endpoint name="RemoteEventServiceEndPoint" contract="EPiServer.Events.ServiceModel.IEventReplication" binding="customBinding" bindingConfiguration="RemoteEventsBinding" address="soap.udp://188.8.131.52:5000/RemoteEventService" />
<endpoint name="RemoteEventServiceClientEndPoint" address="soap.udp://184.108.40.206:5000/RemoteEventService" binding="customBinding" bindingConfiguration="RemoteEventsBinding" contract="EPiServer.Events.ServiceModel.IEventReplication" />
<serviceDebug includeExceptionDetailInFaults="true" />
<udpTransport multicast="True" />
The address attribute values in both the service and client endpoint sections, specify a UDP multicast address and port. This may be changed as desired but the IP address MUST be a UDP multicast address. Firewalls will need to allow communication on the port chosen if multiple servers are used and are separated by firewalls.