Re: Could RAM possibly be just 3-4 times faster than bare hdd writes and reads? or, is the Linux kernel doing its 'magic' in the bg? or, ...
Albretch Mueller wrote:
> also, if in order to use RAID 10 you need 4 drives (but the dollar
> per Gb is approaching $0.02) and you get 1.5 faster performance, what
> is the economy of "bying more RAM" if it is so much more expensive?
>
> Any comparison on HDD, SSD and RAM including pros and cons which is
> worth reading?
First, your measurements were leading you to the wrong
intuition.
Second:
https://www.prowesscorp.com/computer-latency-at-a-human-scale/
excerpt:
System Event Actual Latency Scaled Latency
One CPU cycle 0.4 ns 1 s
Level 1 cache access 0.9 ns 2 s
Level 2 cache access 2.8 ns 7 s
Level 3 cache access 28 ns 1 min
Main memory access (DDR DIMM) ~100 ns 4 min
NVMe SSD I/O ~25 us 17 hrs
SSD I/O 50-150 us 1.5-4 days
Rotational disk I/O 1-10 ms 1-9 months
Internet call: San Francisco to New York City
65 ms 5 years
Internet call: San Francisco to Hong Kong
141 ms 11 years
The scale sets one CPU operation -- doing a math operation,
perhaps -- at one second of human time. The latency is the
amount of time that elapses between the CPU issuing a request
and the answer coming back.
Now, let's talk about operations per second. RAM can accept
requests perhaps once every 40 clock ticks at a clock speed
of 4000MHz, which is to say 100 million requests per second.
https://en.wikipedia.org/wiki/Memory_timings
A high end NVMe SSD might manage 1 million requests per second.
More common is 300,000 or so.
A good consumer SSD can handle 100,000 to 150,000 requests per
second.
A good spinning disk might manage 110 requests per second. Not
110,000, just 110.
https://en.wikipedia.org/wiki/IOPS
Now, let's say you take 4 spinning disks and connect them in
RAID10. That's four disks, A1, A2, B1, B2, where A2 gets a copy
of every write to A1 and B2 gets a copy of every write to B1.
The computer will split writes across the A and B stacks, so
a write will complete in half the time it would to just a single
disk. But for reads, the computer can ask both the 1 and 2 disks
in each stack, so it can handle twice as many reads as a single
disk could in a given chunk of time.
But that gives the RAID10 system 220 IOPs, still nowhere near
the 100,000 IOPs of a single SSD.
Does that all help?
-dsr-
Reply to: