Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does CPU read cache, memory, and disk performance

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to read cache, memory and disk performance by CPU". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how CPU reads cache, memory, and disk performance.

Jeff Dean, an google engineer, was first listed in his ppt document on distributed systems and was quoted everywhere.

1 second = 10 ^ 3 milliseconds = 10 ^ 6 subtle = 10 ^ 9 nanoseconds = 10 ^ 12 picoseconds

Read cache ns level, read memory 100ns, read 1MB 250000ns sequentially from memory, read MB30ms from disk

Numbers Everyone Should Know

L1 cache reference reads CPU's primary cache 0.5 nsBranch mispredict (transfer, branch prediction) 5 nsL2 cache reference reads CPU's secondary cache 7 nsMutex lock/unlock mutex\ unlocks 100 nsMain memory reference read memory data. 100 nsCompress 1K bytes with Zippy 1k byte compression 10000 nsSend 2K bytes over 1Gbps network sends 2k bytes 20000 nsRead 1MB sequentially from memory on 1Gbps's network reads 1MB250000 ns [0.25ms] Round trip within same datacenter from memory order round trip from a data center Ping 500000 ns [0.5ms] Disk seek disk search 10000000 ns [10ms] Read 1MB sequentially from network sequentially reads 1 megabyte of data from the network 10000000 ns [10ms] Read 1MB sequentially from disk reads 1MB30000000 ns [30ms] Send packet CA- > Netherlands- > CA one remote access to a packet of 150000000 ns [150ms]

From small to big:

Clock rate of CPU: abbreviation for the frequency at which CPU operates (the number of synchronous pulses that occur in 1 second). The unit is Hz.

CPU cycle: the time it takes to read an instruction section

Instruction cycle: the time it takes to read and execute an instruction

CPU time slice: the time allocated by CPU to each process

The minimum unit time slice unit scheduled by CPU on Linux is 5ms-800ms.

The Linux scheduler actually recognizes the task_struct for scheduling.

No matter the process thread, the underlying layer corresponds to a task_struct. The difference between the process and the thread is how much resources are shared. There is no resource sharing between the two processes, and all resources are shared between the two threads.

At this point, I believe you have a deeper understanding of "how CPU reads cache, memory, and disk performance". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report