Automatic Web Farm with Search Indexes

Dustin Christians asked on August 13, 2018 17:33

I have a Kentico (v10.0.48) MVC instance running with three web farm servers. There is an API server, a WEB server and the CMS server. The search indexes are out of sync occasionally between the WEB and API servers. Everything appears to be running correctly when all three servers are healthy. All tasks are updating, and everything is in sync when all 3 web farm servers appear in the web farm app. After 24 hours of non-use the API server is removed from the web farm app and when a search index task is created for the WEB server it isn't created for the API server. Is there a best practice for keeping web farm servers "alive" so they don't disappear from the web farm app and they continue to be updated? This is a client’s development site and I am trying to ensure their servers stay in sync even when they are not in use for more than 24 hours. Otherwise, they see different data from the API and WEB server and it gets confusing.

From Kentico's Documentation for Kentico 10: Details for automatic web farms: After 24 hours of zero requests, the system removes the server from the system along with all its web farm tasks.

Correct Answer

Zach Perry answered on August 13, 2018 18:18

Have you tried to manually add the servers instead of automatic? Not sure if it will send a task to a server that isn't "healthy", but worth a shot.

You can set the Server name for each application in the web config:

<add key="CMSWebFarmServerName" value="API" />

0 votesVote for this answer Unmark Correct answer

Recent Answers


Dustin Christians answered on August 13, 2018 18:26

Thanks for the suggestion Zach. I was planning to do that as a last resort. I'd rather leave the web farm on automatic so we don't have to add them in manually when new servers are added or the names change.

Also, I monitored the servers and noticed that as long as they exist in the web farm app within Kentico, healthy or not, there will be tasks generated for them. When the servers are "not responding" or "transitioning", tasks are generated and the server is updated once it becomes healthy again.

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on August 13, 2018 18:36

You could create a scheduled task to rebuild the search indexes every so many hours, and that will trigger the index to be rebuilt on all 3 servers, which should also keep the servers updated. I am pretty sure a rebuild for a scheduled task executes on each server instead of syncing the content between the them.

0 votesVote for this answer Mark as a Correct answer

Dustin Christians answered on August 13, 2018 18:47

Zach, that's not a bad idea. Creating a scheduled task to rebuild the search index is an easy thing to do. The only issue I see with this is that if a 4th server becomes active but should be disabled after 24 hours, it won't be because the scheduled task will always keep all servers alive even if they shouldn't be. If a server should be removed, and it isn't, then tasks will continue to be created for that unused server which wouldn't be the most efficient scenario. We could monitor the servers and delete them ourselves if they are not in use but at some point these sites will become the responsibility of the client and we would rather they didn't have to monitor this if possible.

I will keep this in mind as a potential solution though. Thanks.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.