所以的知识,比如 cache,database。
学到后面有几个高山是必须要跨过去的。
-
网络通信
-
操作系统
-
编译原理
-
数据结构与算法
-
内存知识(磁盘硬件)
查看 linux 机器缓存大小
$ lscpu
所以的知识,比如 cache,database。
学到后面有几个高山是必须要跨过去的。
网络通信
操作系统
编译原理
数据结构与算法
内存知识(磁盘硬件)
$ lscpu
In the early days computers were much simpler.
The various components of a system, such as the CPU, memory, mass storage(大容量存储), and network interfaces, were developed together and, as a result, were quite balanced in their performance.
For example, the memory and network interfaces were not (much) faster than the CPU at providing data.
It is important to understand commodity hardware because specialized hardware is in retreat(消退).
Scaling these days is most often achieved horizontally instead of vertically, meaning today it is more cost-effective to use many
smaller, connected commodity computers instead of a few really large and exceptionally fast (and expensive) systems.
There have been many types of RAM over the years and each type varies, sometimes significantly(显著), from the other.
The older types are today really only interesting to the historians.
We will not explore the details of those.
Instead we will concentrate on(专注于) modern RAM types;
In the section introducing DRAM we saw that DRAM chips multiplex(多路复用) the addresses in order to save resources int the form of address pins(地址引脚).
We also saw that accessing DRAM cells takes time since the capacitors in those cells do not discharge instantaneously(瞬间放电) to produce a stable signal;
Beside CPUs there are other system components which can access the main memory.
High-performance cards such as network and mass-storage controllers cannot afford to pipe all the data they need or provide through the
CPU.
Instead, they read or write the data directly from/to the main memory (Direct Memory Access, DMA).
CPUs are today much more sophisticated(复杂) than they were only 25 years ago.
In those days, the frequency of the CPU core was at a level equivalent to that of the memory bus.
Memory access was only a bit slower than register access.
ps: 内存访问,仅次于寄存器访问。
Before diving into(一头扎进技术细节) technical details of the implementation of CPU caches some readers might find it useful to first see in some more details how caches fit into the “big picture” of a modern computer system.
To understand the costs and savings of using a cache we have to combine the knowledge about the machine architecture
and RAM technology from section 2 with the structure of caches described in the previous section.
By default all data read or written by the CPU cores is stored in the cache.
磁盘大致由盘片、磁头、步进电机等几部分组成组成。
盘面:硬盘一般含有一个或多个盘片,一个盘片包含两个盘面。
磁道:每个盘面被划成多个狭窄的同心圆环,这样的圆环叫做磁道。
扇区:每个磁道的每段圆弧叫做一个扇区,是读写的最小单位。
柱面:所有盘面上的同一磁道,在竖直方向构成一个圆柱,称为柱面。
读写过程:硬盘读取数据时,磁头先移动到读取扇区所在磁道的上方,这个过程耗时叫做磁盘寻道时间,平均时间为10ms。之后,通过盘片的旋转,使得扇区转到磁头的下方,这个过程耗时叫做旋转延迟时间,对于7200转/min的硬盘转一周为60*1000/7200=8.33ms,平均旋转延迟为4.17ms(半圈)。