mysql-redis- disk - Memory (Contact)

Sense: disk data exists; 
1: Dimensions disk
  addressing: MS
  Bandwidth: how much data per unit time flow. G / M
2: Memory: Addressing ns seconds "milliseconds" delicate "ns

In addressing: 10w times less than the disk memory

i / o buffer: cost,
disk the track, sector, a sector 518byte, sector smaller, more cost, (multi-index).


Operating system, 4k memory page size is no matter how much you read, is to take a minimum of 4k from disk (a disk when memory read 4k is stored in memory as a thing).

1: mysql: less than 4k 4k also minimizes waste (because mysql data is read from the disc, the disk corresponding to 4k), no index mysql, as slow read directly from disk.

 2: mysql of b + tree (tree) is stored in memory. Memory to read data pages and index pages read into memory, program memory read directly. More efficient than directly read the memory.

Less than 10 times the disk memory addressing

But memory is limited impossible to keep all the data into memory, hence the cache:

Because the memory is redis database.

redis: 10w / s

mysql:1000/s

 


 

Published 144 original articles · won praise 41 · views 590 000 +

Guess you like

Origin blog.csdn.net/qq_29257691/article/details/104007898