Hacker News new | ask | show | jobs
by H8crilA 2312 days ago
It would be an acceptable solution if the memory supply would vastly outsize the demand, by over an order of magnitude. For example if the program never needed more than 100MiB and you'd install 1GiB or 10GiB. 10GiB is still nothing compared to the cost of the missile, and you get the benefit of truly never worrying about the memory management latency.

My favorite trick to optimizing some systems is to see if I can mlock() all of the data in RAM. As long as it's below 1TiB it's a no brainer - 1TiB is very cheap, much cheaper than engineer salaries that would otherwise be wasted on optimizing some database indices.

4 comments

What’s your rationale for picking an order of magnitude instead of, say, double?
10x is a very safe margin. I suppose 2x is fine if you really know your code (usually you don't, really, unless you wrote all of it yourself).
Well, I’m not sure I’d call buying 1TiB of RAM and mlock’ing it all an optimization.
It is not an "optimization" in the sense that it's not engineer's work.

It is in the sense that it gets the speedup job done.

That’s just throwing hardware at a performance problem, not optimization.
Name it however you want, gets the job done (sometimes).
Double is an order of magnitude.
I suppose it is, in binary. Although humans generally use base 10.

I might have to start saying "a binary order of magnitude" instead of "double" when circumstances call for gobbledygook.

there are always constraints. other than the cost of the memory, which may appear minimal, there are many others. for a missile that bigger memory chip may require more current, more current means a bigger power supply, or a thicker wire. might add ounces to the weight. and in this environment, that may be significant (probably not in this specific example, but look at this perspective for every part selected...they sum up)
> As long as it's below 1TiB it's a no brainer - 1TiB is very cheap, much cheaper than engineer salaries that would otherwise be wasted on optimizing some database indices.

Until you have ten thousand machines in your cluster…

I meant 1TiB total.
One TB of memory is actually quite expensive. And uses a fair bit of power.
Not at all compared to salaries.

I mean just think about how many VMs you can buy for $200k-$500k/yr (total cost to the company of a senior engineer).

According to AWS you could only afford 10 instances each with 976GB of RAM for that salary (500k). If you were to do nothing but just buy the raw RAM it would cost you 50k. But you also need servers [0] to actually put the ram into. So it's probably closer to 70k. RAM isn't as cheap as you think.

[0] and a network and network admins and server admins and and and

So you mean 4-10TiB is the equivalent of a senior engineer via AWS pricing and my rough estimate of the cost of an engineer. I think we agree?