135 points · by frostmatthew · 11y ago · 34 comments
Edit: alright, I got downvoted for speaking a fact. Don't get me wrong, OP's article is great, but not everyone has control over the underlying code, nor has enough time to tinker into runtime nuances.
To confess I have maintained >100K LoC Python/Ruby projects, yet the respawn way is the most effective and easiest mitigation method available and I think it's likely to continue to be in a very long time.
"Sadly, most Ruby devs out there simply employ monit , inspeqtor or unicorn worker killers. This allows you to move along and do more important work, tidily sweeping the problem snugly under the carpet."
The author describes a mindset to solve the underlying problem. Endemic to any language.
Rasmus Lerdorf
More endemic in some languages than others.
http://en.wikiquote.org/wiki/Rasmus_Lerdorf
I mean, I'd be first person to tell you that I am a scripter at heart, but I would never, ever say "I don't care about this [computer science] crap at all." I feel like my job is to defer to the many programmers that are smarter than I am. Including the parser and compiler and linker etc
For anyone who's job description involves writing software and owning it's performance and reliability, process supervisors are a crutch. A crutch to be used only until the memory leak is found and a patch submitted to the relevant project.
A former colleague used to refer to the concept of software entropy. Like physical entropy, it tends to increase. It's both natural and inevitable. But as engineers we sometimes, for brief windows of time, have the ability to impose order on chaos. To locally decrease entropy.
I've seen the end result of relying on process supervisors to work around frequent crashes and memory leaks. The result is that you end up with ruby processes with multigigabyte heaps, resulting in a stack that can only run a few dozen requests/s even on the beefiest of hardware.
To be clear, I'm not saying don't ever use process supervisors. It's just that if they are saving your bacon multiple times a day something's wrong.
I'm also not claiming that inefficient software will cause your company to fail. It's perfectly possible that your buffaloak architecture will keep running until your company dies of natural causes, but I believe that we should have enough professional pride to fight entropy, even if we're the only ones who know what we did.
I don't know how to get the same kind of information on Ruby, Python or node.js but I'm pretty sure it might involve some gdb and debug symbols. No idea.
This really is just pedantry though, because the net effect is "the memory usage chart keeps going up and to the right" in both cases. "Memory leak" is a fine enough term for what's happening in this case.
Ah. I thought I was going crazy. Memory leaks in a managed language (i.e. one with a GC) are solely the fault of the GC implementer and cannot be fixed by the language user.
What is being talked about here is space leak.