当前位置:网站首页>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.
边栏推荐
- [one day learning awk] conditions and cycles
- 张驰咨询:家电企业用六西格玛项目减少客户非合理退货案例
- Stm32f411 SPI2 output error, pb15 has no pulse debugging record [finally, pb15 and pb14 were found to be short circuited]
- Tableapi & SQL and MySQL grouping statistics of Flink
- S32K1xx 微控制器的硬件设计指南
- What is the relationship between network speed, broadband, bandwidth and traffic?
- SAP CRM organization Model(组织架构模型)自动决定的逻辑分析
- Skywalking 6.4 distributed link tracking usage notes
- Sort out the four commonly used sorting functions in SQL
- Flink 系例 之 TableAPI & SQL 与 MYSQL 分组统计
猜你喜欢

An intrusion detection model

采集数据工具推荐,以及采集数据列表详细图解流程

Fix the failure of idea global search shortcut (ctrl+shift+f)

张驰课堂:六西格玛数据的几种类型与区别

STM32F4-TFT-SPI时序逻辑分析仪调试记录

《QT+PCL第六章》点云配准icp系列6
![[leetcode] 16. The sum of the nearest three numbers](/img/60/6a68333d6e543c601e6ed586b830d0.png)
[leetcode] 16. The sum of the nearest three numbers

STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】

Wechat applet 03 - text is displayed from left to right, and the block elements in the line are centered

入侵检测模型(An Intrusion-Detection Model)
随机推荐
leetcode:329. Longest increasing path in matrix
Can I choose to open an account on Great Wall Securities? Is it safe?
【天线】【3】CST一些快捷键
Junda technology indoor air environment monitoring terminal PM2.5, temperature and humidity TVOC and other multi parameter monitoring
"Qt+pcl Chapter 6" point cloud registration ICP Series 6
项目中字符串判空总结
cmake 基本使用过程
Research on manually triggering automatic decision of SAP CRM organization model with ABAP code
It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!
【一天学awk】条件与循环
常见健身器材EN ISO 20957认证标准有哪些
做空蔚来的灰熊,以“碰瓷”中概股为生?
TS报错 Don‘t use `object` as a type. The `object` type is currently hard to use
微信小程序01-底部导航栏设置
Stm32f4-tft-spi timing logic analyzer commissioning record
MySQL 服务正在启动 MySQL 服务无法启动解决途径
采集数据工具推荐,以及采集数据列表详细图解流程
Intelligent operation and maintenance practice: banking business process and single transaction tracking
phpcms后台上传图片按钮无法点击
Wechat applet 03 - text is displayed from left to right, and the block elements in the line are centered