Using 3 CD server to host my sitecore site. Using load balancer navigating the traffic on servers. Some time one of the CD server site goes down how we can get notification. Is there any way run some scheduler to ping or
keepalive.aspx we can extend any idea ?
First of all, keepalive.aspx will be requested by Sitecore automatically based on a schedule task configured in Sitecore.config that run every 15 min to keep the instance live.
<agent type="Sitecore.Tasks.UrlAgent" method="Run" interval="00:15:00"> <param desc="url">/sitecore/service/keepalive.aspx</param> <LogActivity>true</LogActivity>\ </agent>
In order to monitor your CDs response, you can build a monitoring tool that will ping the website each x sec; hence, you can measure your website availability.
Moreover, You will be informed about the exact time that your instance was down for further investigation from Server/Sitecore logs.
Looks like you have very inefficient infrastructure if one of your instances doesn't get any requests through some period of time and it causes application pool shutdown. You can think on shrinking of amount of CD servers.
Timeout, when application pool shutting down is controlled by Idle Time-out setting.
- Open IIS manager on your server
- Open Advanced Settings of Application pool that is used for your website
- Set Idle Time-out setting to 0. (it means that application pool will never shut down, even remaining idle through long period of time)
We have a few ways to solve this kind of issues:
- add your url to the hosts file on the server with
127.0.0.1. Otherwise the request for the keepalive might go through the loadbalancer and you don't have any guarantee that all your servers are hit - possible causing one or more to fall asleep. With this loopback the keealive should go to it's own server.
- use ports to drive traffic to a specific server (eg. 8001 for CD1, 8002 for CD2, ...). You can configure your loadbalancer to handle this - just make sure it's not accessible for everyone. This way you can monitor each server separately.