Troubleshooting web farms
Monitoring web farm servers
You can monitor web farm servers in the Web farm application on the Servers tab. Each server registered in the system can display one of the following statuses.
The statuses report on the ability of individual servers registered in the web farm to connect to the database.
Status |
Description |
Recommended action |
Healthy |
The web farm server is reporting to the system at expected intervals, regularly, without any significant delays. |
The server is working properly. No action is needed. |
Transitioning |
The web farm server is initializing or it stops responding. |
We recommend waiting for about 3 minutes before looking for the source of the issues, as the status will probably change during this time. |
Not responding |
The web farm server is not responding at all. Details for manual web farms:
Details for automatic web farms:
|
The server is down. Check the server physically and check whether it is able to connect to the database. In case of Azure, check the server status through Azure Management Portal. |
When a server switches to the Not responding status, the system logs an error to the event log.
Event log email notifications
You can configure the system to automatically send email notifications whenever errors occur in the system, as described in Setting up e-mail notifications for errors.
If you configure the system to send email notifications, the following notifications related to web farms will be sent:
- When a server switches to the Not responding status.
- When a server switches to the Healthy status.
A notification will be sent once for each switch that happens.
Monitoring web farm synchronization tasks
You can monitor web farm tasks in the Web farm application on the Tasks tab. The tab shows all synchronization tasks that are currently active (waiting to be processed).
In an ideal situation, this tab should not contain any tasks – this means that the web farm tasks are processed soon after they are created. The system automatically removes successfully processed tasks.
The Anonymous tasks tab displays a list of currently active (waiting to be processed) anonymous synchronization tasks. These tasks are logged by external applications (e.g. Windows services) to ensure that changes made by the external application are reflected in the web application cache. Tasks are logged as anonymous only if the application is NOT configured to run in a web farm. If it is configured to run in a web farm, these tasks are logged as standard synchronization tasks on the Tasks tab.
See also: Debugging web farms
Troubleshooting web farms
Incorrect number of web farm servers in the system
If you have configured an automatic web farm and the number of your web farm servers connected to the database does not correspond to the number of servers registered in the system, the web farm will not work properly. This can happen for various reasons. For example, if you tamper with the system time on one of the servers, the system may consider other servers to be down due to the time difference and delete them.
Solution
In most cases, you can solve the problem by restarting the web farm server that is missing in the system or all web farm servers (or at least their IIS). After an IIS restart, Kentico will be able to register the web farm server properly. If you are running your project on Microsoft Azure, you can reboot the instances of your project.
To quickly restart the entire web farm, you can open the System application and click Restart all web farm servers on the General tab.
If the system shows more web farm servers than there should be, the automatic web farm will delete them after some time.
Outdated servers error
Error: [DataConnection.HandleError]: Query: Proc_CMS_WebFarmSync_SetServerTasks Caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint “FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer”.
This error occurs if automatic web farm server generation is enabled and some servers become outdated or new servers are missing in the system.
Solution
Restart the faulty web farm server or all web farm servers (or at least their IIS).
Web farm tasks are not being processed
If the Tasks tab in the Web farm application contains web farm tasks that fail to be processed, the cause can be one of the following:
- The system is configured for more web farm servers than there really are.
- The thread processing the tasks is not running.
- Check if the CMS.WebFarmSync.DbWebFarmUpdater thread is running in Debug -> Worker threads. See Debugging web farms for more information.
Solution
Check the Web farm application -> Servers tab and make sure that the number of configured web farm servers corresponds to reality.
- Restart the web farm servers that are missing from the list or all web farm servers (or at least their IIS). The restart of the IIS registers the servers back into the web farm and also runs the thread that is processing the tasks.
- If there are more servers than there should be, wait for the system to automatically delete them together with their tasks.