MHN
Add a comment on Hacker News →
139 comments
  1. A thousand times, yes. I now do rolling reboots in my clusters, partly because I needed to get a lot better about keeping them patched.

    Once you trust your HA, you just take the server or service offline, do what you need to do, and then turn it back on. And you have a backup plan of “it’s trivial to just spin up a new server because we made sure to test that regularly, too”.

    Occasionally we do “pull the power cord” (or more realistically tell the ups/peu to turn it off), and then testing that AMT/iLO/iDRAC/whatever functions to turn it back on. If you have things set up properly this can all happen with almost no effort via an agent harness.

    The same is true if you’re relying on clustered storage or RAID at all. You’d better periodically just fail over off a drive (and should do this rolling) instead of waiting for a drive to fail.

    1. This is also why I built certain data extraction / data migration workflows at work using restores from backup.

      One direct advantage: This lowers the risk of negatively impacting production, because it doesn't touch production.

      But much better, it acts as a continuous restore test, at least of yesterday. I can certainly construct many ways why this could be insufficient, but I know yesterdays backup can be restored. That's more than quite a few teams know.

      At the low price of enduring a bit of latency, which is fine for a lot of business processes.

    2. Prior workplace had DR Days every year and they were a thing to look forward to. When it was first implemented, nothing went to plan but after just a few years there was only minor anxiety each time.

      Nothing filled blindspots in staff documentation more than those findings.

      1. You should have probably done them more often than once a year (perhaps once a month) in those early days?

      2. One of the things about cloud providers is you can do drills of trying to migrate the entire thing to a new region to test worst case disaster recovery. The tricky bit is making sure nothing touches the old region due to hard coding.

      3. > DR

        Data recovery?

        EDIT: Wrong! It's "disaster recovery".

        1. disaster recovery

          1. Dang, so close. Thanks!

            1. It's only data recovery if the disaster recovery goes wrong. :)

      4. In a previous job a customer had a monthly site switch.

        One time a technician messed up the switch, and the next time the switch started overwriting current data with old data (part of the switch procedure involved switching storage sources from a site to another).

        Another time a technician went the extra mile to fix the current site rather than do a failover because they hadn’t ever executed the failover procedure and wasn’t sure they could make it work correctly (the technician that had originally setup the DR failover had left the company and the current technician was fairly junior). Btw the junior technician from this specific episode was me circa ten years ago.

        DR procedures can often get very complex and technical, not really just a matter of ticking boxes left and right.

      5. The transitions I have seen so far -> actual DR exercise -> table top exercise -> DR lives in the doc presentation or strategy documents

        I miss it though. Somewhere down the line the expectation bar has gone down in a circular fashion

        1. > DR lives in the doc presentation or strategy documents

          I imagine the answer to the question "Does the disaster recovery plan work?" is probably similar to "Do you backups work?".

          In flight training you rarely do "multiple unrelated failures" because you need tightly controlled scenarios for fair and efficient assessment. In ground school (or when you have extra time in the simulator) you can think about the systems and environment in more detail and be creative in solving bizarre, unrealistic problems. For experienced people doing the same thing every day this is a great opportunity for learning a couple times per year.

      6. I worked in a place that did a yearly disaster recovery check - it wasn't a very good check obviously as they actually needed it one day, and it took about a week to recover from the disaster.

        Meanwhile somewhere else, dedicated servers were used heavily but failover happened monthly at most, but regularly more often.

        1. A customer stopped a major patch of multiple systems with a notification two weeks prior, because it's "not enough time to set up emergency communication" at which point we wondered, what emergency let's your company set up communication over two weeks before anything bad happens...

    3. The problem there is that is opens the feedback loop for memory leaks. And that becomes a situation that hits around the holidays because you deploy less which means the application runs 2, 3x longer than it usually does, for three weeks out of seven.

      1. I highly, highly recommend a forced rotation of a week max, such that all deploys/hosts roll over on a weekly basis. For large clusters I recommend that nodes continuously churn so that there is always a rotation in progress.

        I don't recommend this to paper over memory leaks -- you still need to fix those! But it results in tremendous stability.

        1. > For large clusters I recommend that nodes continuously churn so that there is always a rotation in progress.

          And pay the AWS Config tax (if you use AWS). I mean, literally pay, as in it will cost you extra money if you use autoscaling a lot and have a poorly configured AWS Config setup.

        2. > I don't recommend this to paper over memory leaks -- you still need to fix those! But it results in tremendous stability.

          I'm not actually sure you really need to chase after slow leaks? It feels dirty, but honestly, restarting each part of the system randomly around once a day is good anyway. (Or once a week as you say.)

          If you can leak faster than that: sure, fix it. But if you slowly leak a few MiB per hour of running, you might just ignore it?

          1. > From: k...@rational.com (Kent Mitchell)

            > Subject: Re: Does memory leak?

            > Date: 1995/03/31

            > This sparked an interesting memory for me. I was once working with a customer who was producing on-board software for a missile. In my analysis of the code, I pointed out that they had a number of problems with storage leaks. Imagine my surprise when the customers chief software engineer said "Of course it leaks". He went on to point out that they had calculated the amount of memory the application would leak in the total possible flight time for the missile and then doubled that number. They added this much additional memory to the hardware to "support" the leaks. Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention.

            1. And then some years later an order comes for an extended range version...

              I've seen so many projects get bitten somewhere down the line by such shortcuts. Much easier to fix them when they're first created than to hunt for them a decade later in a codebase that was supposed to be proven in the field, but suddenly stopped working properly.

          2. The problem is if you don't chase it you can never be sure if this is just a slow leak, or a symptom of a more significant problem that hasn't hit yet. There are many many ways your system can be seriously wrong yet the only obvious symptom is the memory leak. Worse, once you accept one memory leak because it really is not a problem (in the majority of cases a small leak is not a problem under the constraints you have set) when a second memory leak can sneak in under your leak thresholds and be ignored even though the leak is just the first sign of a major problem.

            If there is a bug, no matter how minor, fix it before any other feature work is allowed. That is the only sane way to keep a system sustainable.

        3. The key to making this feel less arbitrary is making stability is a secondary effect of something the business already wants—velocity. By having your CI pipeline be fast, meaning the time from approve to deployed should be sub 30 minutes, sub 15 ideally, you're running deploys continuously (during the workday at least) and your velocity and responsiveness to issues and bugs goes way up while ops gets stability and predictability.

        4. Thanks for sharing this. This is something i'll definitely implement moving forward.

        5. That’s no panacea either. Some requests that can fail at runtime still need to succeed during bootstrapping and restarting during “low traffic periods” invites getting paged during low traffic periods.

          I did all but the last mile on autoscaling work. I thought we needed about three months more work, the guys who took it over decided it needed to be done in time for year end performance reviews. They skipped things and also ignored my advice on tuning parameters. Twelve days later we had the worst outage in two years because they didn’t account for unknown unknowns while I did. A bug in Operations’ Terraform did not preserve current machine count during a redeploy, and their initial min cluster size was laughably small.

          In my next 1:1 I told my boss it was worse than that because they held a vote to ignore my advice of ramping down instead of jumping to best case. My boss was as appalled as I had been. Fucking told you so.

          By the time they had dialed it in they had exactly the settings that I proposed which they thought weren’t aggressive enough. The fact that my numbers were not that compelling is why it had been my priority 3 instead of Priority 1 in the first place. It didn’t actually save us all that much more money than I already had with the work up to that point.

          Our reloadable config system needed Consul to be up and populated during bootstrapping. If it went down any time after that it would fall back gracefully to the last known configuration and exponentially back off. In situations like that, turning off a server for 20 minutes a day is an increase in risk with zero upside, since billing doesn’t even work that way!

          At the end of the day I think I probably didn’t make enough of a stink about how much and for how long I had been working on that problem and how it was foolish to reassign it at that point in the process. At a minimum it should have been all three of us with me cross training.

          Give a distributed computing problem to people with no formal training and they always ask how hard could this really be. Real hard, but also not if you commit to do some counterintuitive things religiously.

          1. Well on the bright side your boss understood the problem -- tired of broken AB tests that border on fraud :|

      2. In some high reliability contexts you actually don't want an uptime higher in production than you've tested. This is not just due to leaks but various potential counter overflows, etc. If there is no significant degradation for the user, there is little reason to not reset the system periodically.

        But I wouldn't necessarily aggressively restart servers that rely on netboot or other quirky, non-self-healing tech (systemd service ordering, DHCP, various VPN and network drive implementations)

        1. Yes, I'd rather live through the 1000th groundhog day for your servers than getting to an uptime of 1,000 days that no one has ever tested.

          And in an emergency you might want to restart your system anyway for other reasons (like rolling out a fix), so having that path well-trodden is good.

          1. In a real emergency you won't have a choice about rebooting. When your fuel supplier can't get your backup generators more fuel...

            In the 1990s more than one company learned this the hard way. The mainframe had more than 10 years of uptime - every component was hot swap-able and that was tested often enough. However when the disaster (I heard stories from people who couldn't talk about details so I'm not sure what) took out all power and the generator - the system couldn't reboot because so many services that were started manually over the years by someone who since left ... nobody had a clue how to start them anymore (many needed some other unknown services running first). It took months to figure out what should be running and get the system back.

        2. Consul was the bottleneck on ours. And while a Raft protocol is not the worst external dependency, it’s difficult to spin up from 0 so it limits the parallelism available to spin an entire region up from zero under a time crunch.

    4. It's a good idea to just schedule and proactively replace hard drives too, especially depending on the grade of it.

      1. Good idea for infinite money, but if you don't have a huge storage cluster, modern disks don't fail all that much. Super rare for enterprise level ones. I've operated many dozens, I had like one or two fail over 5 years and those were already over 10 years old. I found SSDs more finicky.

        1. For a project we bought 10 laptops and hired people after. Seven of those hard drives failed in about five months. Bad batch. Statistical clustering is what you’re planning for in disaster recovery. What do we do when no single point of failure can take out the system but three happen at once?

          1. Yes, when buying disks for a big RAID, they should not come from the same batch. Good vendors take care of this.

            1. Best to still buy the same drives from different vendors if possible.

              Laptop manufacturers should be mixing it up but they might find it more useful to have the failures clustered.

        2. What about cycling through? The additional drive can be your "hot spare" or "cold spare".

        3. Most people don’t buy enterprise grade drives though.

          Western digital also lied about their CMR tech in their NAS grade drives.

          If one is using something like a synology, they are generally reliable and can run for 5-10y before anyone notices they’ve had it that long.

          Replacing drives at the 5-10 year range can happen naturally if the rain needs to be eventually grown as well. Having a spare drive on hand is something to factor into the original cost.

      2. I have a fleet of server pulls which still are running 6-7 years later. In my experience once a drive gets past 50,000 hours, as long as you monitor SMART and temperatures it’ll last forever. (Proper airflow is essential.)

        I generally run RAID-1C3 plus a hot spare (periodically take it to C4, and then back to C3 to rotate what the hot spare is), with a cold spare on the shelf. With CephFS it’s a bit different but basically the same idea.

        1. I have seen the same, also it’s about how much load is on the drives and if that type of load is a strain for it.

          Smart drive notifications is key

      3. For home stuff, I try to replace hard drives on a schedule, but economics win. For work stuff, my experience was spinning drives offer pre-failure indication if you monitor smart; ssds fail less often, but I never got an indication before failure. Historically, most of my servers would be replaced before you really start to worry about storage lifetime, but hardware stays useful longer these days.

        There have been firmware issues across multiple manufacturers where a lifetime counter rolled over and made the drive inaccessible ... if you knew in advance, you could pull those out of service before they failed, but how would you know.

        For personal drives, I try to buy one at a time or at least bring them up a few weeks apart. For work drives, sometimes you just end up with a huge batch of servers coming online at the same time. Hopefully backups go to different systems.

      4. No, it really isnt! What a stupid thing to say!

        Use (soft)RAID, have hot spares, done.

        Lemon drives usually fail within the first weeks, good drives keep running for years long after their 5th birthday.

    5. > fail over off a drive

      ...and test the entire chain, up to and including paging on-call.

      You do have alerts for fail over events, right?

  2. >>> If you want <ANYTHING> to work well, use it often!

    This has been a design requirement for any system in our infrastructure team that always prioritizes reliability. Also testing, no matter how frequent and realistic it is, is not the solution. Sometimes you need to make failover/recovery/failstatic part of a normal workflow and mitigate its impact at the cost of efficiency.

  3. I think there's a broader point here, which is if you want _anything_ to work well, use it often. Bugs spawn easier in rarely exercised code. One of the things I'll often push at work is that if we _have to_ be good at handling some Rare Scary Thing[0] then we should, if practical, try to bring the scary part into more commonly exercised code, because it makes the Scary Thing happen more often and you'll get better at it faster. Otherwise you end up making the happy path work and just kind of hope you covered the rest of it[1].

    Failover is a great example because in many business cases you _have to_ be good at it when you have the very bad day, but there are ways to avoid it in steady state.

    [0] E.g.: Complex authz logic, deploys, interactions with a fragile remote service, etc.
    [1] Obviously you shouldn't just cover the happy path, but you and the people you work for probably like money and it will be hard to justify pre-bulletproofing some edge case than the median one.

    1. This is exactly why dog-fooding when possible is such a good product strategy. You will hit up against the rough edges of your solution if you use it yourself often.

    2. [dead]

  4. A few years ago there was an interesting article about the Nordic bank Nordea. Apparently they hadn't tested failover to their backup datacenter for years (14 years). They were afraid it would fail and didn't want to deal with the fallout of a failed test, so they didn't test. At that point having a backup datacenter is purely an annoying cost that exists only as a regulatory checkbox.

    Still absolutely fascinating that some companies do not test their failover plans.

    https://www.version2.dk/artikel/laekket-rapport-nordea-kunne...

    1. > Still absolutely fascinating that some companies do not test their failover plans.

      Same for backup.

      I was Unix sysadmin at a fairly big Norwegian company for a couple of years and responsible for backup of the servers and workstations. I asked repeatedly for resources to conduct a recovery exercise so that we would actually know if it worked. I was turned down every time.

    2. The very idea of manual DR testing once a year or something makes no sense. It’s difficult to maintain and execute, and there’s too much of a need for institutional knowledge.

      For most, the path forward is probably going to be multi-regional cloud setups.

    3. I would have expected the regulatory list was also including a checkbox for "tested twice a year" or something? Unless they were lying on that, in which case they could have been lying about anything (including having any failover).

      1. There's regular failover or site-swapping and then there's "DR testing".

        Many institutions are scared of regular failover or even doing a proper DR test often because they aren't 100% sure it'll work, and even if it does if they can fail back. The result is you get very isolated testing to say you're technically compliant without being confident you could in a real situation.

        1. Yes, a lot of the time it’s enough to do a tabletop test of disaster recovery. Which just means a bunch of people sit around a table and discuss what they would do if the system failed.

          It’s a terrible substitute for doing the real thing. But it’s common.

        2. People still spooked from the failed Chernobyl Reactor DR test.

  5. I like the idea of injecting failover into the release process. Another similar approach is chaos engineering, where you intentionally introduce failures to validate your systems' reliability.

    When I was at PagerDuty we regularly ran Failure Fridays (perhaps they still do). The goal was to identify a victim sub-system and start applying all sorts of failures to it - excessive latencies, dropped server connections, availability zone outages, etc. It was all done in a controlled manner, with the operations team sitting together with the service owners. The idea was that even if there is an impact to the customer, it's much better to catch it now and fix the underlying issue with many eyes on it, rather than a bleary-eyed on-call dealing with it in the middle of the night. This sort of exercise was very scary to get started with, and only minimally-impacting failures were introduced, but over time we got to the point where we were comfortable with simulating a full region outage.

    That said, such investments in reliability made sense for PagerDuty. If a company can survive just fine with 2-3 nines of availability, it's a lot harder to make the business case for it.

    1. Playing with compounding error/fail/degraded states is one of my favorite things to do during downtime - if I’m light on higher priority work, I’ll dig up a bunch of edge cases and write fixes for them, then turn it into a small writeup to share with the crew, so it doesn’t look like I don’t have enough ‘real’ work to do.

    2. [dead]

  6. Also, there is testing a failover, and testing a failover.

    We tried it and fired some basic requests to a web app and it all appeared to work fine but a colleague noticed the monitoring system blipping for a minute or so when failing back again even though the apps seemed fine.

    I was too sloppy to worry since "it all looks OK" but eventually he managed to narrow it down to the firewall state not replicating back properly due to something in Proxmox ip tables. It wasn't just affecting the monitoring software but anything with an existing connection and that would have been really ugly to a customer. Now that it is fixed, we are completely confident failing over, which we use to patch the host servers roughly once per month.

  7. Used to work at a high functioning eng org/compary and we did regular practice failovers. It was fun and very effective at making sure the machinery worked.

    At new co. we do not do that and paid the price with some bungled outages.

    However, I am conflicted on if the juice is worth the squeeze. Never seemed like the added complexity and cost of having something to failover to was worth it. Whether that's another cloud, AZ, region, plus architectures that would permit failover, and all this coordination and drills. Just doesn't seem worth even a really bad outage. Business case dependent of course... The costs are colossal, and seems like one of those things managers would advocate for to get budget and head count and do work for the sake of work.

  8. One of my favorite was "Do you trust your RAID?'

    Confident "yes"

    And then I would put my finger on the tab to pull a drive.

    If they didn't flinch I would pull the drive out.

    1. For years, back when the datacenter was down the hall from the offices, if we were doing an application upgrade we’d first go out and pull one of the drives from the RAID. If everything went well with the upgrade, we’d push the drive back in and let it rebuild. If something went wrong with the upgrade, we’d power down, boot off the drive we pulled, and be back up and running with minimal downtime.

      Some nights I would pull dozens of drives. I guess we had a lot of trust in the RAID.

    2. Apocryphal story (friend of a friend): they visited their data center and the person giving them the tour pulled out a drive. But instead of gracefully recovering, the system broke down. Turns out a colleague had given a tour earlier that day and pulled the same trick; the cluster hadn't rebuilt yet.

    3. Hah, I hit this exact thing with btrfs raid. Don't remember the details, but if a device disappears from kernel POV and then reappears, btrfs will think there are two devices with the same UUID and get into really weird states, eventually hanging. No data loss, but impossible to recover without reboot (btrfs seems to maintain its own internal table that cannot be cleared, and you can't even rmmod it in this state)

    4. i trust my RAID but would flinch knowing my hotswap doesn't work :(

      1. A certain type of hardware failure is indistinguishable from the drive being pulled out.

        1. Drive pulls often results in voltage spikes of a type that drive failures won't result in.

        2. I had this hardware failure recently. An SSD grew some bad sectors that, when read, caused the drive to just disappear. Poof, gone. It took ddrescue + over 400 manual replugs to get the remaining data off the drive. With Claude making a script to automatically proceed after each replug, it only took about 3 hours, which I think was perfectly reasonable.

          The SSD had lasted 9 years, served me well. Rest in peace.

      2. A hotswap raid isn't a raid if you can't pull a drive without thinking. Of course, raid 5-10 is minimum and mandatory.

        1. Not entirely the case, for example NVMe doesnt really have a consensus on whether its hot swappable today, some work and some dont work unlike HDDs

          1. I don’t think you’re saying we should use nothing until we know about NVMe’s definitively?

            RAIDs are about using what works as a baseline —- that is overwhelmingly HDDs.

    5. I did this many years ago with a client who had bought a big server upgrade to demonstrate what they had just paid for. Server crashed immediately. Found that HP did not build the server to specs, there was no RAID set up. Luckily I had someone to blame.

    6. [deleted]

    7. [dead]

  9. This principle was documented in a well-known Usenix paper from 2014:

    “Large, production quality distributed systems still fail periodically, and do so sometimes catastrophically, where most or all users experience an outage or data loss. We present the result of a comprehensive study investigating 198 randomly selected, user-reported failures that occurred on Cassandra, HBase, Hadoop Distributed File System (HDFS), Hadoop MapReduce, and Redis, with the goal of understanding how one or multiple faults eventually evolve into a user-visible failure. ...
    We found the majority of catastrophic failures could easily have been prevented by performing simple testing on error handling code – the last line of defense – even without an understanding of the software design.”

    https://www.usenix.org/conference/osdi14/technical-sessions/...

  10. I have a few saying that i often repeat at work, and one of them is; if you are afraid of doing it, you are not doing it often enough.

  11. This is the philosophy behind FoundationDB.

    There aren't "normal" and "recovery" reconfigurations, there's just recovery (with a few exceptions for planned maintenance).

    This means: 1) simpler code, 2) you're constantly testing the recovery path, and 3) the recovery path is designed to be quick because it's constantly happening

    1. I always remember a time in college when I was proud of my cat-like reflexes. I was ice skating, and started to fall. My gyrations trying not to fall at all ended up with me flat on my back, with ice skates near my head and arms. If I had taken a knee it would have been over quicker and safer.

      I see people do the same thing at work all the time. You can hurt yourself trying not to hurt yourself. People try to make the happy path wider and deeper and let the corner cases get more expensive and use bad statistical thinking to justify it as an improvement. But the corner cases can come in clusters, and people train themselves to not see those clusters in the telemetry. But the customers see it, and the disconnect makes it worse.

  12. This is really good advice and I think everyone in the industry is learning this the hard way right now because of the recent avalanche of AI-discovered CVEs.

    I have an opinion that uptime is largely a vanity metric. It might feel nice to have a year of uptime on a router or server, but not if it has been a year since said device got updated.

    It is a bad sign if management will not approve maintenance because they cannot accept downtime. The loss of any single device should, ideally, not create any outage. If it does, then this indicates a flawed system architecture. I like to frame it as, "this thing is so important that we can't maintain it."

  13. What happens if your Primary is free (on-prem) and your Failover is costly (public cloud)? We push either new services or updates to existing services several times a day, failing over each time is possible but would incur extra costs which we would need to justify, especially if we are not also testing our DR triggers!

  14. At one of my last employers we swapped our primary and secondary trading servers every Monday morning and each was rebuilt (fresh OS, redeploy) every month. This was all fully automated.

    There were also spare servers, connected to switches, just sitting idle that were rotated in and out of the rotation.

    When a single server being down can cost you tens of millions of $ a day you develop good recovery

    This is without all the fancy cloud infra that makes it so easy to be resilient today

  15. I will say though that the first thing you need to know is not Practice Makes Perfect but rather Recency Bias. Eventually a process that works 98% of the time will convince you that it works 100% of the time and the safeties will come off. Human error will grow and grow until there is a reminder that you need to respect the process.

    And to make any process popular, you also have to make it far more robust than you would have thought, because people judge on incidents per unit time not incidents per 1000 instances. Anything you want used 2x as much needs to aim for 4x stability. You will underestimate use and overestimate your improvements so you need a safety margin to reduce overall incidents per month.

  16. Let me add, "make it easy" to use, maintain

    I know for a production service that's easier said that done, but even for home user. Maybe this isn't the same thing but for 10-15 years I backed up my photos. I backed them up to local NAS hard drive and backed them up to google long term storage via Arq. It was a PITA to set up. Arq wanted admin permission to Google Cloud, like most poorly designed software, so they could just "make it work". I wasn't about to give an app my admin credentials. So I went through the trouble of setting it up manually.

    Then, the machine doing the backup aged out and getting it working again on a new machine was always too much work. Eventually after like 5 years of not backing up I deleted the cloud thinking someday I should switch to an easier solution. Then the hard drive I had died. I now no longer have the photos.

    I feel pretty stupid. Stupid for losing them. Stupid for not fixing the backup. Stupid for wasting 15 years keeping them backed up at all just to then lose them.

  17. This goes for all resiliency measures. If you’re not practicing and testing your systems under duress you have no clue if they will work as expected when they are actually needed.

  18. A better approach is to treat failover as a mode of operation.

    My neighborhood suffers of prolonged, frequent blackouts, esp. in rainy weather.

    Some 15 years ago I got fed up and defined a sudden power loss as a mode of operation. (Mind you, I self-host the mail service of my family with the servers sitting in my basement. To me, a power outage is more hassle than just "Flip that switch back, hon!").

    Since I implemented the new architecture and operational procedures, the only remaining inconvenience is that, oh, mail gets delayed until the mains come back. I (or the members of my family) do not need to touch literally a thing.

  19. Like any first aid training, you need to refresh so that you can act fast when it matters. It's not done with a bunch of extremely smart and complex measures, it's by drilling, as often as you can.

  20. The title alone - words to live by. At $enterprise we failover to a different DC once a week. The process to do so is ever-evolving and improving.

    A few years ago it took 8 hours and 10-15 engineers to release software (Oracle DB-backed, running migrations + deployments done on inactive nodes first). That’s down to 1-2 minutes and a single engineer now, and pushing for on-demand releases. Not too bad for a company founded in the nineties.

  21. Also, test your backups with a restore. Otherwise you just have files that may or may not be an actual backup.

  22. Exactly. The only way to know your failover works is to make it the primary path. I apply the same to software: my tools don't have an 'offline mode' — they are offline mode. The network is treated as an optional enhancement (e.g., 'save this file' button writes the HTML to disk), not a dependency. When the internet drops, the user doesn't even notice because nothing changed.

  23. In one of my previous jobs, we scheduled recurrent tasks (monthly/quarterly/annually) and one of them was fire drill to check failover on hardware failure. Failovers of frontline servers like web servers, app servers, cache servers, authentication servers were bread and butter, which were usually stateless. Needed to make sure the temporary reduced capacities not causing a cascaded failure. Failovers of storage servers and databases needed more attention. Needed to ensure transactions were committed/rolled-back correctly and data were consistent.

  24. I worked with a tech lead that basically applied blue-green to regional deployment so we were constantly flipping between the two. The stack was small, so I’ve always thought that was brilliant, but completely overkill until I started working on a project that could actually benefit from that approach.

  25. A daily life example of this with larger stakes involves GFCI/AFCI (RCD in Europe), and circuit breakers in general. You should regularly turn off all your circuit breakers to make sure they can indeed break the current, and you should regularly push the test button on your GFCI outlets/devices and GFCI/AFCI breakers to make sure they can actually trip. Shutoff/switching mechanisms can and do get stuck, and this can be very very bad in the case where you need it!

    1. Some GFCIs "self-test" internally, but it's worth making sure safety features actually work.

  26. For those old enough to remember "this is a test, this is only a test" being a national event, that's exactly what was being tested.

  27. I wonder if that's one pressure for animals for most creatures to have finite lifetimes. The reproductive cycle is the closest we get to "tear it down and start over".

  28. We run 5 redundant clusters and keep traffic to one of them weighted as if 2 of the clusters have fallen over to make sure our software will be able to handle the load when clusters inevitably have hardware failure. Then of course we actually test a cluster being down every time one is rebooted for kernel updates.

  29. This also applies to restoring from backup.

  30. I've gone a bit wild and let an AI agent handle everything.
    It's a continuous 24/7 maintenance agent updating app dependencies, rebuilding docker containers, creating and testing backups, trigger cluster switchovers, update servers. It's not uncommon for a switchover to happen every 24 hours.

    1. Hey it's in maintenance mode now and needs to open all the ports and disable the firewall to test a patch....

      1. In my experience, the opposite is true. It actually takes a lot of tuning to stop the agent from bailing out prematurely on an easily solvable issue.

        Even if we entertain the disabled firewall scenario, my supervisor agent monitors Prometheus events and would have detected those open ports and intervened. The same goes for disk space, uptime, latency, or an open SMTP relay. Having that kind of feedback loop is a major pillar of this automation.

        1. [dead]

  31. Same as any skill or muscle. Use it or lose it. It goes for our brain, our body, our tools, and the entire system of software we use. If it isn't used, consolidate or delete.

  32. Overall, yes, this is a very good article

  33. You never know if your disaster recovery scenario will play out without an actual disaster drill, up to the point of physical disconnection of uplinks.

  34. Companies rarely test this because they have no desire to test this. There is no management push to get it done and massive downside in testing causes outages which impacts engineering teams.

    Coupled with most companies rarely need uptime they claim they need. Most companies I've worked at, downtime rarely resulted in lost revenue.

    1. Perhaps oddly, almost every company I’ve worked at suffered real financial pain as a result of outages. Lost production at one that did quick-turn manufacture to order, and two more with customers that (rightly) demanded steep SLA penalties. None of them got to a point where failover was comfortable.

      With my own company I started doing zero downtime deployments (I run hot/hot over multiple AWS regions) literally from day one. Our rate of rollouts has been slower this year than last, with only about 1,500 so far.

      Constant failover is a big win in my experience. Hard to retrofit, though.

    2. Often, occasional short downtime is acceptable, longer downtimes are not. I think for a lot of systems the complexity of hot zero-downtime failovers is not worth it (but it is still worth practicing the short ones).

  35. This stuff is good when there really is a business case for it. But too often it can just be a nerd snipe rabbit hole to build the equivalent of a tank's robustness for some web app with 10 users or some infra where a day of outage would not cause much trouble.

    There is such a thing as overkill and using a sledgehammer to crack a nut. It's like when everyone wanted to introduce Kubernetes because Google uses it. Chaos monkey etc are great ideas but diving super deep into this with a prepper's paranoia for all kinds of dreamed up contingencies can be a form of procrastination, unless a business case can be clearly articulated.

    1. The problem is that reliability can be hard to add later when you need it. Single machines can lead to bad practices like not documenting changes or not backing up databases that lead to longer downtimes. Also, people talk about building SaaS and there is obligation to keep working for paying customers or they will leave.

      Kubernetes makes reliability easy and leads to better practices. It used to be reliability was hard, but using the cloud turns day of outage into something unnoticed.

      1. The step from 1 to 2 is the big one; if your app is designed to work on a single machine it'll have a lot of assumptions that will make it hard to make it run on two; but if you start from two at the beginning you'll be able to add more pretty easily - but you often get stuck on the database somehow.

        1. Yes, maybe it will be hard, but how hard? One or two days of intense work? Or months and months? It matters. If it's hard but doable, maybe it's fine to take on that tech debt initially in the name of developing the actual app and it's features instead of getting stuck on making sure everything is future proof when you don't know what the future actually looks like.

    2. I don't think that, with modern stacks, that adding chaos monkey is that big a change - considering the benefits you get from knowing that you in fact have resiliency

      1. I'm not arguing against any one thing. I'm just noticing in the comments that people are piling on that you should also do X Y and Z any of which may be sensible but at some point you need more people to maintain such a tower because you can quickly end up with a situation where maintaining all the checks, alerts, scheduled rehearsal tasks etc give you more overhead and more overhead and more of a tangled mess that nobody understands than before. Like you will have some alerts, but nobody knows if they truly are serious and there will be alert fatigue. There will be tools checking on other layers of tools and this whole infrastructure can become harder to maintain than dealing with downtime, and is harder to keep track of than simply deciding to accept a risk and having a rough plan. Again, case by case! Depends on your team size, budget, priorities, customer tolerance, etc etc. All I'm saying, there are tradeoffs! More of this stuff is not always better.

        And I think it can be procrastination like when people optimize their lifting regime to the death and buy all the gear but don't end up going to the gym much. When you don't know what to implement, adding more alerting, more testing, more automation layers can be a convenient infinite time sink. You can always add more of this. More monitoring monitoring the monitoring.

        Bonus: I do know about and use AI agentic engineering for these things. Still there is a limit. The limit is higher than before, but not infinite.

    3. [dead]

    4. [dead]

    5. your politics of failover have failed! it's time to make them work again!

  36. we just keep a DR environment that never has any traffic routed to it unless a disaster happens. what could go wrong?

  37. The public clouds got it right: active-active is the only load balancing mode that should exist.

    All of my deployments are zone redundant and all sites are always serving live traffic. Databases write in only one zone but read-only workloads are steered to the replicas at the other zones.

    This leads to hilarious audit workshop conversions.

    “How often is the secondary site tested?”

    “All the time.”

    “What does that mean? Monthly?”

    “Continuously.”

    “Daily?”

    “No, it’s tested all the time, moment to moment, request by request. All day, every day.

    “Ooookaay… I’ll put down ‘daily’ on the form.”

    1. I 100% agree with "if you want failover to work well, use it often". I would be a bit uncomfortable with only-yearly testing absent some really really strong constraints; if you really do need to pay for the expense of failover, you might as well have a process to ensure it actually works when needed.

      I 80% agree that people should consider active-active; it's the ideal from an engineering reliability perspective, and for transactional apps, should even be doable at the database level for conventional databases. Probably the best balance of cost and reliability might be a monthly swapping of regions to work out bugs in your process and run books, and to also ensure new code or environment changes are not overlooked. In clouds you could potentially suspend or size-down resources in the fallback region. Weekly or blue-green deployment alternating would be somewhere in-between.

      It *is* possible even to do active-active with two writers and bi-directional replication with datacenter in different geographic regions with different power grids. I did it with off the shelf Microsoft SQL Server once upon a time although one could potentially do it nowadays with Postgres v16+. Keeping bi-directional replication working wasn't easy but was possible. There were two key parts to this:

      1. Webservers on one region by default routed to database servers on the same region. After some jittered exponential backoff failed, they would try the other region. All database access by our code was mediated by a single set of our own wrapper libraries to facilitate/ensure a common failover pattern (and common logging).
      2. Primary key seeds for new rows were odd on one site and even when created on the other, both incrementing by two.

      In hindsight, I'd estimate we had more failures of our services due to byproducts of failover handling of some aspect going wrong than actual underlying failures of the hardware and datacenter, so active-active isn't for everybody. We were supporting telecom-type services so management supported the engineering effort.

      It's tricky nowadays to do active-active with modern analytical/columnar database stacks which tend not to expose their WALs or prioritize such reliability. That'll be more of a problem as agents start to rely more on them.

      Monitoring and automated recovery of bi-directional replication glitches/failures wasn't easy back then but it might be more straightforward in this agentic age where the eval criteria is essentially to ensure eventual consistency modulo some measured acceptable variance.

    2. What you describe is often not enough, as in a real failover event, a smaller percentage of the hardware has to handle the entire load. There are entire classes of errors that only happen when you actually shut down entire azs, or even regions at a time, and leave them down for hours.

      1. In a typical setup, the devops pipelines would use rolling zone-by-zone outages to deploy new code, so that's also tested relatively frequently.

        I typically work on systems with negligible load, so this isn't an issue for us.

        In the past I did work at an organisation with a large user base where more than a hundred physical servers dedicated to a single app was normal. They had a data center with power issues that would experience frequent brownouts, which eventually forced every team to make their apps fail over automatically and robustly. This included having spare load capacity to handle double the normal load at the remaining DC.

        I always found it ironic that "frequent power issues" caused availability that was better than it was before the power issues started!

        1. [dead]

  38. Reboot your servers every week. I still remember the panic about having to reboot a critical on prem host that had been up for 5 years.

    1. I have an urge to recompile/reinstall an operating system on an irregular but frequent basis if only to clear it of any accumulated frass.

      In a like mind, I try to be certain to spend a few days with mains power turned OFF to prove that backup battery is still able to failover and to sustain for a minimum duration. I log the KW hrs utilized and the battery SOC after each instance.

  39. Frustrated dev speaking:
    I'm so tired of this whole sre madness. Canary, failover, firedrills, argol whatever that is, 50million stale dev environments with microservice ai generated state that is completely fake and inconsistent in every single one. Devs wanna just ship a feature to sync some data twice a year but the whole overcomplexity engine that is modern deployments has gone so far that you need to study a million tools before you can do anything meaningful. What happened to just a bash script and some well designed code. For everyone but maybe 5 companies globally we don't need all that shenanigans. But you have to grind your resume driven development and only the most overcomplicated nonsense makes you look serious. This industry is a joke and i can't wait for it to all fall apart

    1. You can acknowledge the risk or not acknowledge the risk.

      If you choose to acknowledge the risk you can price the risk or not price the risk.

      If you choose to price the risk you can fund the risk.

      If you fund the risk you are managing the risk.

      I know people who drive around without car insurance, other people who don’t have life insurance. There are also people who are over insured at the other end of the spectrum.

      It depends on what you’ve promised people giving you money and what you’re going for.

    2. There are certainly levels to reliability. Not everything needs canary or active-active-active deployments worldwide. It’s very easy to put together well-intentioned, overly complex solutions in the name of resiliency. It’s a balancing act finding the right level for what you’re building.

      But I will say, the bar for some reliability is pretty low. If your local grocery store's checkout system were down, that would be bad for both them and you. Now a smaller grocery store probably doesn’t need globally deployed active-active-active nodes. But they probably still need a way to recover quickly and reliably. How long can they really tolerate being down?

    3. You can just spin up a couple VPSs and put a load balancer in front and call it a day. No one is stopping you. This is what I generally do, unless something more complicated is truly necessary, and I'm very happy.

      1. Yeah technically yes, but I'm talking about the standard that modern devops and sre are setting. Suddenly org policies are introduced that force using a company wide helm chart and that base image with that process yada-yada. Maybe there's still places with more autonomy to just spin up whatever, but I see alot of the opposite not just in my org.

        1. Fair. At a certain scale unfortunately some level of oppressive bureaucracy and structure is probably necessary.

          Of course management is often prone to over doing this, and managing engineers are prone to over building.

          This is more a general business & people problem that applies to all areas though

  40. So true.

    But also: this is true of literally any feature or behavior. If you don't use it often, regressions can creep in, or weird race conditions might not get noticed, etc. If you want things to keep working as intended, you have to use them.

  41. I only trust HA fail over to actually work if companies have been doing frequent switch and stay for years. Switching every 6 months is the minimum IMHO but the more frequently the better.

    1. Some really good tips and ideas in these comments.

  42. pets nearterm, cattle longterm. plus chaos monkey. the only way to be sure your system is resilient in face of BadThing is to ensure BadThing happens every once in a while

  43. One of the best examples I learned in a datacenter setup was to pull cables every so often. :)

  44. Is this a restatement of the chaos monkey - that is, in order to make sure the system is resilient, some organisations have something that deliberately breaks things

  45. [dead]

  46. [dead]

  47. [dead]

  48. [dead]

  49. [dead]

  50. [dead]

  51. [dead]

  52. [dead]

  53. [dead]

  54. [dead]

  55. [dead]

  56. [dead]

  57. [dead]

  58. [dead]

  59. [dead]

  60. [dead]

  61. [dead]

  62. [dead]

  63. [dead]

  64. [dead]

  65. [dead]

  66. these are easier said than done, because using failover means potential (and likely ) customer disruption.

    The Devil is in the details, and because many tech solutions are a hodgepodge of open source, commercial and home grown components, the failover strategy also needs investment.

    Convincing me to do more failover drills is not the hurdle needing overcome. Unlocking the budget to develop and exercise the protocols is the hard part.

    1. You might have missed it further down this article, but this person suggests adding failover to your release process. During a release, you can switch the network traffic to the failover environment, then release updates to the original environment, test them there, then switch back to the original environment.

      Worked at company that did this. Didn't know why at the time, but seems like a really good idea.

      1. How did they mind the resources ? (Time , money )

        1. Hmm, good question. Wasn't apart of devops or specifically, release engineering (am a software dev), so am not sure. But my educated guess was that their prod environment was surprisingly small for a high-volume ecommerce website (they are one of major sites on which you can resell tickets to events). Think each prod environment didn't have that many servers, only 2 or 3 or something like that. I can't remember the exact number, but I remember being surprised that it was so low given the volume of traffic they had - although, me being on the dev side, you don't get a good feel for how much traffic is truly "high-volume" and how much compute you'd need.

          And one thing they did to mind money is they kept their engineering team small, ~500 people, and this was before AI. At that time, they should have had 50% more engineers, because most were being worked to the bone. It was a very stressful place to work (but learned more in that one job than all my other jobs combined).

    2. > customer disruption

      Not an excuse. Run a parallel environment that isn’t customer-facing if you’re forced to so that you can drill. Either you’re going to disrupt your customers or an act of God will, and your customers won’t let you scapegoat God.

      1. > a parallel environment

        In my experience, the issue with this is simulating production in a meaningful way. Let’s say you have 10k mobile users, how can traffic approximate that well enough with network conditions, p99 user behavior.

        It’s as good as possible but like parent points out, not necessarily worth it.

        1. Performance testing (and failover testing is a kind of performance test, since you are checking whether the system continues to work under a certain kind of load) is always about whether a particular shard holds to perf expectations, then extrapolating by multiplying out your number of shards and whether that will serve your expected amount of traffic.

          If you have a single server servicing 10k users, and it's not financially practical to generate 10k users worth of traffic, you first find a way to split it, say, 2 processes serving 5k users each. This halves your risk of a single process's failover not succeeding. It also allows you to test failover on a non-customer process that serves many fewer users (5k vs. 10k) and thus requires both less compute to serve and less compute to stress-test - so it's cheaper.

          You do need to appreciate that getting engineering rigor to work for you does typically require making changes to your systems - like thinking more intentionally about horizontal shard size.

      2. How about the budget ?

        1. If the budget can't support functional failover, then functional failover cannot exist.

    3. Good failover means zero customer disruption.

    4. Original devops is creating an environment that can be fully rebuilt and reprovisioned effortlessly. 1

      With software and solutions, until that exists, there is no failover. Whether it's how a cloud is used, or self-hosting on resources works, or a hybrid.

      Disaster planning and other risks are things accounting departments can usually get behind to test and test often. The cloud can seem alluring to pay instead but it doesn't always work out.

      1. Just because you can reprovision it doesn't mean you can reprovision it quickly enough.

        What works with say, 10,000 files might still work 10,000,000 but on no timeframe anyone can tolerate.