2015-01-27-Understanding the difference between buffer and cache from the experiment-Wu Weishun

Source: Internet
Author: User
Using the Du (find) and cat to reflect the buffer vs. cache differences Experiment:

Experiments show that:

1 Normally buffer << cache

2 "File system" related content (Inode, etc.) cached in buffer, "file System"-independent (that is, file content) cached in the cache

With:

Objective: To improve the IO efficiency of Linux

Properties: Transparent to the program (everything is a file in Linux)

IO layer: Data that caches other slow IO layers in memory. (IO: Network < Disk < memory < CPU cache)

Vary

Buffer ' s policy is first-in, first-out

Cache ' s policy is Least recently used.

Before I simply thought:

Buffer is for a character device, and the cache is for a block device.

After studying today, I understand that buffer and cache become:

Buffer optimizes IO speed through management (Queue implementation async), and cache optimizes IO speed through memory (data dwell). Buffer is understood as an element queue and the cache is interpreted as a copy of the data.

2015-01-27-Understanding the difference between buffer and cache from the experiment-Wu Weishun

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.