So I made a bit of a mess with this the the first time round and when it ended up on Slashdot (I had assumed that wasn’t happening as the delay between positing and it appearing was a few days), I was left rather embarrassed.
With a thanks to all those who commented and pointed out the errors – here’s my attempt to do it properly. I haven’t agreed with all the comments – eg it was pointed out RAID wasn’t an option in the mid 80s so shouldn’t be part of a comparison now, but I think this is about real world choices, so RAID would probably feature, etc…
This paper – The 5 Minute Rule for Trading Memory for Disc Accesses and the 5 Byte Rule for Trading Memory for CPU Time – looked at the economics of memory and disk space on big iron database systems in the early/mid 1980s and concluded that the financial trade-off between disk space (then costing about $20000 for 540MB disk (about 3.7 cents or there abouts per KB) and (volatile) memory (about $5 per kilobyte) favoured having enough memory to keep data you need to access around once every five minutes in memory.
It then compared the cost of computing power (which was estimated to cost about $50,000 per MIPS) and memory – eg if you compressed data to save on memory space you will have to use additional computing power to access the data. Here the trade off is calculated to be about 5 bytes of memory per instruction per second.
What do these comparisons look like now? The original paper explicitly ruled out applying these sort of comparisons to PCs – citing limited flexibility in system design options and different economics. But we won’t be so cautious.
The five minute rule updated
Let us consider a case with 2TB SSD disks. These cost about £500 (and probably about $500, we are approximating) and let’s say we are going with a RAID 5 arrangement – so actually we need 4 ‘disks per disk’ (£2000) and the cost is then 0.0001 penny per kilobyte (about 4 orders of magnitude less than 35 years ago).
As discussed above I am using the RAID figure even though RAID wasn’t a practical option in 1985 because I think this is about real world choices not theoretical limitations.
And memory – for simplicity we are going to say 128GB of DRAM costs us £1000 (an over-estimate but fine for this sort of calculation). That means memory costs about 0.001p per KB – a fall of around 7 orders of magnitude.
Using the same regimen as the original paper – but considering 4KB pages – and assuming that the disk system supports 10000 accesses per second then the cost for a disk is about 5p/a/s (about 5 – 6 orders of magnitude less than in 1985). We ignore the costs of supporting a disk controller here but conceivably we might want to add another few pence to that figure.
If we then think that making one 4KB page resident in memory saves 1 access per second, the disk cost saved is 5p at the cost of 0.004p. Saving 0.1 accesses per second saves 0.5p at the cost of 0.004p and the break even point is roughly 0.0008 accesses per second – or alternatively we need to hold pages in memory for 1/0.0008 seconds – 1250 seconds or about 20 minutes.
Alternatively this means caching systems should aim to hold items that are accessed every 20 minutes or so.
And the trade off between computing power and memory…
As mentioned above, back in 1985, computing power was estimated to cost about $50,000 per Million Instructions Per Second (MIPS). These days single core designs are essentially obsolete and so it’s harder to put a price on MIPS – good parallel software will drive much better performance from a set of 3GHz cores than hoping a single core’s 5GHz burst speed will get you there. But, as we are making estimates here we will opt for 3000 MIPS costing you £500 and so a single MIPS costing 17p, and a single instruction per second costing (again approximating) 0.00002 pence. (Contrast this with a low-end microcontroller which might give you an IPS for about 0.00003p or a bit less).
Computing power has thus become about 5 orders of magnitude cheaper – but as we note above memory prices have fallen at an even faster rate.
Now an instruction costs 0.00002p and a byte costs 0.0000001p, so we need to save about 200 bytes to make an additional instruction worthwhile – meaning that cost-efficient data compression of easily accessible memory is hard to do.