Unofficial Hacker News client - receive Push Notifications on replies.

If you want failover to work well, use it often (opens external site)

532 points by madflojo 1 day ago | bencane.com | 140 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (15)

  1. 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.
    Replies (2)
    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.

      Replies (5)
      1. Thanks for sharing this. This is something i'll definitely implement moving forward.
      2. 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.

        Replies (1)
        1. Well on the bright side your boss understood the problem -- tired of broken AB tests that border on fraud :|
      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. > 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.

      5. > 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?

        Replies (2)
        1. 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.

        2. > 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.

          Replies (1)
          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. 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)

      Replies (2)
      1. 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.
      2. 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.

        Replies (1)
        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.