当前位置:网站首页>Reading notes of top performance version 2 (V) -- file system monitoring
Reading notes of top performance version 2 (V) -- file system monitoring
2022-07-01 15:27:00 【jrglinux】
《System Performance: Enterprise and the Cloud, 2nd Edition (2020)》 Reading notes and brief notes
8. file system file systems
8.2 Model
8.2.1 File system caching

A cache hit , Read from main memory ;
Cache miss , Read from disk ;
8.3 Concept
8.3.1 File system latency
File system latency is the primary metric of file system performance, measured as the time from a logical file system request to its completion.It includes time spent in the file system and disk I/O subsystem, and waiting on disk devices—the physical I/O. contain :
- Time spent on the file system itself
- disk I/O Subsystem time
- Disk waiting for physical I/O Time
8.3.2 cache caching
The file system uses main memory (RAM) To do caching , To improve performance , In this way, the application can start from RAM Read and write in , Not physical disks , Less logical I/O latency.
8.3.3 Random and sequential I/O

8.3.4 Prefetch prefetch
A large number of file sequences I/O when , Maybe the amount of data is too large to be put into the cache , In this way, the cache hit rate is low , Affect performance .
Prefetching is to check the current and previous I/O File offset for , It can detect whether the current load is a sequential read load , And make predictions , Issue a read command to the disk before the application requests it , To populate the file system cache .
8.3.5 read-ahead read-ahead
Namely prefetch,Linux System call is added in readadhead(2) Allow the application to display the warm-up file system cache .
8.3.6 Write back cache write-back caching
Write-back caching is commonly used by file systems to improve write performance. It works by treating writes as completed after the transfer to main memory, and writing them to disk sometime later, asynchronously.
8.3.7 Write synchronously
A synchronous write completes only when fully written to persistent storage (e.g., disk devices), which includes writing any file system metadata changes that are necessary. Synchronous write is better than asynchronous write ( Write back cache ) Much slower .
8.3.8 bare I/O And direct I/O(raw and direct)
bare I/O: Bypass the file system , Send directly to disk address . For example, database software .
direct I/O: allow app Bypass the cache and use the file system , It's kind of similar Write synchronously ( But the lack of O_SYNC The guarantee provided by the option ).
8.3.9 Non blocking I/O
open() Pass in O_NONBLOCK perhaps O_NDELY Option uses non blocking I/O.
8.3.10 Memory mapped files memory-mapped files
For some applications and loads , Map the file to the process address space , And directly read the memory address , Can improve the file system I/O performance .
system call mmap() establish ,munmap() The destruction . Mapping can be done with madvise() adjustment .
8.4 framework
8.4.1 I/O Stack

8.4.2 VFS
VFS (the virtual file system interface) provides a common interface for different file system types.
8.4.3 File system caching

| buffer cache | Buffer cache | Linux used a buffer cache at the block device interface to cache disk device blocks. The size of the buffer cache is dynamic and is observable from /proc. |
| page cache | Page caching | It cached virtual memory pages, including mapped file system pages, improving the performance of file and directory I/O. It was more efficient for file access than the buffer cache, which required translation from file offset to disk offset for each lookup. |
| dentry cache | Directory cache | The dentry cache (Dcache) remembers mappings from directory entry (struct dentry) to VFS inode, similar to an earlier Unix directory name lookup cache (DNLC). |
| inode cache | inode cache | This cache contains VFS inodes (struct inodes), each describing properties of a file system object, many of which are returned via the stat(2) system call. |
8.4.5 File system type
| FFS | fast file system (FFS) |
| ext3 | |
| ext4 | |
| XFS | XFS is supported by most Linux distributions and can be used for the root file system. |
| ZFS | combining the file system with the volume manager and including numerous enterprise features, making it an attractive choice for file servers (filers). |
| btrfs | The B-tree file system (btrfs) is based on copy-on-write B-trees. This is a modern file system and volume manager combined architecture, similar to ZFS, and is expected to eventually offer a similar feature set. |
8.4.6 Volumes and pools volumes and pools

The file system has always been built on a disk, which is a disk partition , Volumes and pools enable file systems to be built on multiple disks , And you can use different RAID Strategy .
Volume combines multiple disks into a virtual disk , Build a file system on this . Volume management software :Logical volume manager,LVM.
边栏推荐
- Flink 系例 之 TableAPI & SQL 与 MYSQL 分组统计
- [STM32 learning] w25qxx automatic judgment capacity detection based on STM32 USB storage device
- Summary of week 22-06-26
- What if you are always bullied because you are too honest in the workplace?
- Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
- 《QT+PCL第六章》点云配准icp系列6
- openssl客户端编程:一个不起眼的函数导致的SSL会话失败问题
- TS报错 Don‘t use `object` as a type. The `object` type is currently hard to use
- go-zero实战demo(一)
- 《QT+PCL第六章》点云配准icp系列5
猜你喜欢

《QT+PCL第六章》点云配准icp系列2
![[STM32 learning] w25qxx automatic judgment capacity detection based on STM32 USB storage device](/img/41/be7a295d869727e16528041ad08cd4.png)
[STM32 learning] w25qxx automatic judgment capacity detection based on STM32 USB storage device

Introduction to MySQL audit plug-in

Survey of intrusion detection systems:techniques, datasets and challenges

重回榜首的大众,ID依然乏力

Wechat applet 02 - Implementation of rotation map and picture click jump

【LeetCode】16、最接近的三数之和

Skywalking 6.4 distributed link tracking usage notes
![Opencv Learning Notes 6 -- image feature [harris+sift]+ feature matching](/img/50/5c8adacea78e470c255070c8621ddd.png)
Opencv Learning Notes 6 -- image feature [harris+sift]+ feature matching

Survey of intrusion detection systems:techniques, datasets and challenges
随机推荐
Qt+pcl Chapter 9 point cloud reconstruction Series 2
【LeetCode】16、最接近的三数之和
《QT+PCL第九章》点云重建系列2
Apk signature principle
Tableapi & SQL and MySQL insert data of Flink
22-06-26周总结
Wechat applet 01 bottom navigation bar settings
Hidden rules of the workplace that must be understood before 30
【STM32学习】 基于STM32 USB存储设备的w25qxx自动判断容量检测
What data capabilities do data product managers need to master?
微信网页订阅消息实现
Filter & (login interception)
Using swiper to make mobile phone rotation map
What are the test items of juicer ul982
Returning to the top of the list, the ID is still weak
opencv学习笔记六--图像特征[harris+SIFT]+特征匹配
Opencv learning note 4 -- bank card number recognition
Introduction to MySQL audit plug-in
k8s部署redis哨兵的实现
Survey of intrusion detection systems:techniques, datasets and challenges