265 points · by pabs3 · 4y ago · 125 comments
Source: xoogler, developed a reputation for black magic debugging, debugged both of those things. Correctness still matters, no matter how big you are or how much you think auto-restarts help.
"Oh you can spend $x * 80 hours debugging or $x * 2 hours putting a patch to constantly restart"
It's hard to quantify the impact of having a house of cards system with components constantly restarting to side steps bugs until the whole thing lights on fire in a cascading failure later (oh the service scheduler was down for 30 mins and things are restarting so much a massive amount of capacity went offline during that time)
If you have a second to engage, I have found that I learn best in sandbox-types of environments, ie repls, notebooks, etc. What method do you find yourself going back to when you need to expand your understanding of a big production system like at Google? It might be my own ignorance, but I'm not sure how to move into big-systems engineering with low-stakes realism.
Depends on the domain.
For example we had our devices for impaired vision people stop responding to touch events on our cheap OEM touchscreens when German locale was enabled. Turns out linux driver used locale-specific code to read calibration configuration so each event position was scaled by orders of magnitude :)
The funny thing is that then they fixed that in the driver and if you had commas in the config file as a workaround - you get a kernel panic :)
I would honestly say that all developers outside of companies who activity are going to run out of cash in 6 months have the time and are given the choice.
When management says, we don't have the time the reality is the proposed time given goes beyond a reasonable allocation of time, the max capacity given and or managers bullshit radar amount.
Great developers also are able to factor these tasks into their own ticket time to make the time for the issue.
I've been in countless meetings where individuals will complain about the state of X, how this is a hack, or we should really fix that.
Plenty of times I've seen, "You've got two days of dedicated time to identify, solve and implement."
This is met with various results, individuals taking the time, don't really do any work and consider it free time.
They spend two days just trying to understand even how all the components fit together. Even if you revisit in a month with another two days they'll spend the same two days relearning the same information because they did not retain or make notes to be able to pickup where they left off.
On a rare occasion someone will come in and fix it or move the needle further for the next person. All of these issues tend to funnel into these types of developers and from my sampling they're ~1 per 100 developers at a company.
If all companies would don't care, open source wouldn't be there where it is.
Especially if you're running open source. Yes there are sponsored open source developers, but do the people who don't care even submit a bug report more than half the time?
I want to work there too!
That said, I really wish this wasn't the case. I miss the days when efficient software really mattered (just look at modern tv firmwares, or even mobile stuff).
I still remember coming in to 'take over' a new product one (crazy) guy had written. It had no safe guards at all - no queueing, kept everything in memory, no retries or really error handling other than printlines. I remember pointing out 'what if x happens', where x is a really realistic scenario, and the author(and VP) kept saying 'oh thats a caviar problem.' When I asked what that meant, they said "by the time we have to worry about that scenario, we'll be so rich we'll all be eating caviar." Apparently retrying network requests or getting say, 50 requests at a time would make us all millionaires or something.
Predictably, the thing fell over multiple times per day until we trashed it and started from scratch...and I still have no idea what caviar tastes like.
>understanding dark magic
That is the original Unix black magic: KISS and do the simplest possible thing that works and when in doubt use brute force and so forth. That is the "C" language of infrastructure.
In the particular in the scenario we're discussing, there's always a pool of several servers ready to handle a HTTP request (or DB query, or multimedia transformation, etc.). Rebooting a small % of this pool, rather than debugging every single memory leak is a pragmatic, cost-effective solution. "Zero bugs" is a very abstract and detached goal; "cost effectiveness" is a very realistic and wholesome goal.
You can think of garbage collection as being an early admittance that it's far simpler to just clean things up in bulk on a periodic basis, than it is to keep track of every resource you're allocating, and making sure that it's freed at the earliest possible time.
Restarting a service after it's been running for hours, because of memory leaks, seems like a broader implementation of a similar notion... despite best efforts, sometimes services just accumulate cruft, and so long as you can properly drain clients to another server before restarting, is it really that bad to have to restart it periodically? I think of it as an extra long GC pause that frees everything up.
There's a sweet spot where "good enough" really is good enough, and I don't lament it all that much.
Where by "current" you mean "always has been" (I remember this being a solution to early Rails problems, for example)
Can you better define "it"?
> and have infected the whole community with the idea that none of it matters and servers and processes are just cattle.
Perhaps if by "community" you mean the "run everything on VMs on the cloud" people...
(realtime == consistent run time, predictable behavior, != “fast”)
But it’s a not a good excuse to be wasteful! which is why I like that Rust and Go are getting more popular
I think there are two problems with "hard core" debugging: 1) these things are costly and will usually pull in the best devs (so no one will be working on that "important" UI-related ticket that should have been finished a week ago /s). 2) for the management team, spending 10-15 hours fixing one-line or/xor/bit-flip magic stuff doesn't make much sense, and I'd usually get responses like: "oh, it was THAT simple?". Yeah, right, none of you'd seen I've read that Intel manual twice and re-evaluated my math knowledge multiple times over the last two nights :D
And yes, it is used in production in very big companies.
The main thing that was monitored was actually the restart rate/memory increase rate, i.e. a restart every 6 hours: ok, a restart every 30 minutes, not ok.
Where are you getting this?
The article is about a tool Facebook made specifically because they have teams doing deep-dive analysis of even rare bugs that occur in their systems. This suggests the opposite of Facebook being the type of company that looks the other way when crashes occur.
We had a problem where the server would OOM after about ~10K search requests.
Solution: put in a counter and exit(0) after 9K requests (a config option).
Time goes on. Server starts OOM-ing again.
Solution: change the config to exit after 8K requests.
Time goes on. Server starts OOM-ing again.
Solution: change the config to exit after 6K requests (daring move, one would say).
Time goes on. Server starts OOM-ing again.
Solution: change the config to exit after 4K requests.
That's around when I left the company
https://www.theregister.com/AMP/2020/04/02/boeing_787_power_...
From a software engineering perspective - seems like something that should be fixed. But apparently someone else decided not to. Maybe complexity? Cost?
Why go through the entire recertification process when the alternative solution is simply reboot every couple of weeks?
The tl;dr version is that there are 10^80 atoms in the known universe, a computer with 1MB of memory can be in 2^1,000,000 or 10^300,000 possible states. Worse with a thousand times more memory. The easiest, quickest, perhaps the only, way to get it into a known state is to reboot it.
(Amusing introduction: "I took Friday off to be at home, because I can't get any work done at work, too many interruptions")
(I like Joe Armstrong's sense of humour here, dry, understated: "A prompt came up saying 'there's a new version of Open Office' and I thought 'That's good, it'll be better'.".)
That sort of cavalier attitude to memory leaks doesn’t really fly when we’re talking potentially millions of dollars in server costs going down the drain.
drgn looks more user-friendly and maybe faster though.
It seems like Facebook is really trying to fully rebrand as Meta; even the Facebook 'about' page displays Meta instead of Facebook: https://about.facebook.com
Its nice to have a fast, scriptable debugger. I'm thankful that it (partially) works on FreeBSD now.
Most? Just network gear, or are there other general purpose operating systems in the mix?
Apple have weird T&Cs for running virtualisation software
love projects like this...
If you've never had the pleasure to use mdb/kmdb, you don't know what you're missing.
* Stack tracing needs architecture-specific support which is currently only implemented for x86-64 and ppc64. It's not too hard to add for other architectures, so if this is a feature you need, please open a GitHub issue and I'll get around to it soon. * 32-bit ARM doesn't support /proc/kcore, so drgn can't do live kernel debugging on 32-bit ARM. This seems to be due to historical reasons rather than any technical limitations, so I may send a patch to enable /proc/kcore for future kernel releases. AArch64 doesn't have this issue.
Userspace application debugging with drgn also has a couple of limitations mentioned in the blog post, namely the lack of breakpoints and stack tracing for live processes. Again, feel free to open issues asking for these so I know to move them up my todo list.