如何解决写入磁盘的成本
我想基于以下链接确认对磁盘写入成本的理解:http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html
我可能会丢失它,但是在这里我看不到写入磁盘的成本:
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 100 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 10,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Read 1 MB sequentially from network 10,000 ns
Read 1 MB sequentially from disk 30,000 ns
Send packet CA->Netherlands->CA 150,000 ns
但是,随后的总结表明我们可以得出以下结论:
Writes are 40 times more expensive than reads.
我想念什么吗?
更重要的是,我可以得出结论:向磁盘写入1MB的成本是:
40 x 30,000 ns = 1.2 sec (not including the cost of the disk seek which is 10 msec)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。