Grokking Operating Systems and Networking for Backend Engineers
Vote

0% completed

​

The Page Cache and Buffered I/O

On a cloud server, a small Python program read a 1 GB file of order records from start to end, and the read took 4.90 seconds. The same program then read the same file again, and the second read took 0.12 seconds, about 40 times faster.

The program and the file were the same both times. The difference was where the data came from: the first read went to the disk, and the second was served from a copy that the kernel had kept in memory without being asked.

This page explains that copy, called the page cache, how reads and writes use it, and how written data reaches the disk later.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content