Load balancer cache remove problem

Vukasin Andjelic asked on January 31, 2022 10:09

We have two sites A and B, CMS for each site is on the same server, and both sites have two presentations servers P1 and P2 (A and B share the same servers for presentation).

The problem that we have is:

 Change is made on the content page in the Pages app (saved, published), and one presentation server presents a new value and another presents cached (old) value.
 Presentation server which presents cached value presents it next 10 min or sometimes we need to recycle app to remove the cache.
 Behavior on the sites:
    - A site:
        - P1 remove cache immediatly
        - P2 still present cached value
    - B site:
        - P1 still present cached value
        - P2 remove cache immediatly

On both sites web farms are healthy, and in the tasks, there are no tasks.

My expectation was that for the A and B sites we will have the same problem on the same presentation server (P1 or P2), and I was suspicious that it is something wrong with that server, but as you can see it is not that problem.

Sometimes P1 doesn't remove cache sometimes P2 (there is no pattern for which one will work correctly).

We are using Kentico 13 Core, a load balancer for both sites, and two presentation servers per site (P1 and P2).

Any kind of help will be great.

Thanks in advance.

Recent Answers


Petr Dvorak answered on February 1, 2022 08:31

What kind of cache do you mean? The default Xperience feature (no custom implementation) or a custom caching in C# (using CacheHelper or IProgressiveCache)?

If using a custom caching, are the correct cache dependencies defined in C# code?
Is in Settings -> Versioning & Synchronization -> Web farm -> Allow synchronization for selected Cache option?

Which hotfix version are you using?

0 votesVote for this answer Mark as a Correct answer

Vukasin Andjelic answered on February 1, 2022 09:39

What kind of cache do you mean?

We are using IPageDataContextRetriever to get the current page, and also we are using CachingRepositoryDecorator from Dancing Goat. For the current page, we are getting cached values as also from the repository which uses Cache attributes.

If using a custom caching, are the correct cache dependencies defined in C# code?

If cache dependency is not correctly defined, then removing cache will not work at all, but for one presentation server cache is removed but for another, it remains.

Is in Settings -> Versioning & Synchronization -> Web farm -> Allow synchronization for selected Cache option?

Yes, the option for Cache is selected in Settings.

Which hotfix version are you using?

For site A it is v13.0.51 and for site B it is v13.0.45.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on February 2, 2022 14:01

Hi Vukasin,

Could you check your license please? On the License keys app have a look at Web farm servers column to make sure it has Unlimited value, or 3 at least (CMS, P1, P2). If it says 2 I think this scenario is not covered by your license.

0 votesVote for this answer Mark as a Correct answer

Vukasin Andjelic answered on February 2, 2022 14:24

Hi Dmitry,

it is Unlimited value.

0 votesVote for this answer Mark as a Correct answer

Petr Dvorak answered on February 2, 2022 14:57

Are you using Automatic or Manual Web farm mode? How many server do you see in Web farms module? Does this correspond to all your running instances on all servers (site A/P1, A/P2, B/P1, B/P2 + all instances of CMS)?

0 votesVote for this answer Mark as a Correct answer

Vukasin Andjelic answered on February 2, 2022 15:11

Hi Petr, We are using Automatic web farm mode. In the web farm app, I see always CMS, P1, and P2 for both sites and they are healthy.

Best regards

0 votesVote for this answer Mark as a Correct answer

Petr Dvorak answered on February 2, 2022 15:23

Hi Vukasin,

each running process must be listed individually in the Web farms module. In Automatic Web farms mode Kentico generates the server name by machine name and virtual directory. If you have multiple projects/sites on the same server and this combination is not unique, multiple processes are identified as the same web farm server.

Please see the orange warning box in the docs.

If this is your case, you need to specify a unique CMSInstanceNameSuffix/CMSWebFarmServerName value in appsettings.json/web.config of each running instance as mentioned in the docs (the web farm mode will still be Automatic ).

After this change you should see not 3, but 5 servers in the Web farms module (CMS, P1/A, P1/B, P2/A, P2/B).

0 votesVote for this answer Mark as a Correct answer

Vukasin Andjelic answered on February 2, 2022 15:53

Hi Petr,

If I have two separate projects (A and B) that are only on the same servers machines (so 2 different codes are). So we have two separate CMS, why I should see in CMS 5 servers? It is logical to see only CMS current instance, and 2 presentations for that site.

Best regards

0 votesVote for this answer Mark as a Correct answer

Petr Dvorak answered on February 2, 2022 16:58

Hi Vukasin,

ok, sorry for misunderstanding. I understood you have a single CMS with two sites=two frontends running on two servers. In this setup you would have five running processes/instances.

If you have two independent CMS installations with two independent databases and each has a single site with a frontend running on two servers, than the 3 instances in the Web farms module for each CMS is of course correct. In this case I do not have any other ideas.

0 votesVote for this answer Mark as a Correct answer

McGrath James answered on February 16, 2022 08:00

Navigate to DNS Load Balancer -> Load-Balanced Record -> {record name} Untick Cache responses option. Save the changes. Once the changes are applied the Cache is cleared. Navigate to DNS Load Balancer -> Load-Balanced Record -> {record name} Tick Cache responses option. Save the changes.

0 votesVote for this answer Mark as a Correct answer

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