Here’s the deal:
Having the same site deployed 3 times in a local IIS, there is a static class that holds static values. The goal is to ensure all nodes (app pools) “know” when to reload the cached values. I’ve tried using a recurring job but turns out that only one node runs the tasks, so I ended up having only 1 node being updated.
I do understand this is the desired behavior, but, is there a way to have local processes (per node/IIS Site /APP Pool) running on each node? Not only the first one that attends it?
There isn’t a way to say “run this BackgroundJob on all BackgroundJobServers”. You can cheese it, by creating a unique Queue/BackgroundJobServer per instance and then “fan” the BackgroundJob that reloads the your cached values out by enqueuing it on each unique Queue. Obviously each instance will need to know about the other instance’s queue name to be able to enqueue to it.
If you’re using your static classes that hold static values as a cache, you may be narrowing the window for synchronization issues but you won’t completely eliminate them with this kind of strategy. Depending on the complexity of your app, this could turn into a real multi-thread/process nightmare to troubleshoot.