I have a small web load so one server with Cloudflare’s CDN has been more than enough for our speed and security needs (“primary origin”). I have another server (or origin) that is a reasonable replica of our production server, but it’s a little slower, and it doesn’t have all the features turned on - it’s used as my failover server (“second origin”) with a ratio of 100% to the primary origin and 0% to the second origin during normal operations.
While backing up my primary origin to an offsite storage place in the cloud, it slows to a crawl. This is expected since the amount of data I store is large. A backup takes about 12 hours, so I start it during a time when we’re not expected to get much web traffic. In doing so, I manually fail over to the second origin when I begin the backup, and manually failback when the backup is done. The backup is only done on friday nights.
How do I automate this type of timed failover? I’m hoping there’s a way to do so without scratching the API, but I can’t seem to figure out how to do so. I don’t want to have so many pieces of logic that need to run in order to make it successful, since the more dependencies there are in automating a task the more likely something will break…
I thought about forcing a shutdown event by switching out the keywords that the monitor is looking for on the page that it’s monitoring (and I could do this at the server level). But if I did this, would the session stickiness still work? E.G., if it so happened that someone was browsing our website and was in a session (we have a cart), this would terminate it completely (correct?) Is there a softer way of approaching it?
Thank you kindly!