当前位置:网站首页>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.
边栏推荐
- 【STM32-USB-MSC问题求助】STM32F411CEU6 (WeAct)+w25q64+USB-MSC Flash用SPI2 读出容量只有520KB
- What is the relationship between network speed, broadband, bandwidth and traffic?
- Summary of empty string judgment in the project
- Introduction to MySQL audit plug-in
- 【一天学awk】条件与循环
- Returning to the top of the list, the ID is still weak
- What are the EN ISO 20957 certification standards for common fitness equipment
- Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
- Implementation of deploying redis sentry in k8s
- 【目标跟踪】|模板更新 时间上下文信息(UpdateNet)《Learning the Model Update for Siamese Trackers》
猜你喜欢
cmake 基本使用过程
Intelligent operation and maintenance practice: banking business process and single transaction tracking
[STM32 learning] w25qxx automatic judgment capacity detection based on STM32 USB storage device
张驰咨询:锂电池导入六西格玛咨询降低电池容量衰减
S32K1xx 微控制器的硬件设计指南
How to realize clock signal frequency division?
Qt+pcl Chapter 9 point cloud reconstruction Series 2
张驰课堂:六西格玛数据的几种类型与区别
微信小程序03-文字一左一右显示,行内块元素居中
Introduction to MySQL audit plug-in
随机推荐
Summary of week 22-06-26
采集数据工具推荐,以及采集数据列表详细图解流程
phpcms后台上传图片按钮无法点击
《QT+PCL第六章》点云配准icp系列2
MySQL 服务正在启动 MySQL 服务无法启动解决途径
The last picture is seamlessly connected with the first picture in the swiper rotation picture
idea中新建的XML文件变成普通文件的解决方法.
Build MySQL master-slave server under Ubuntu 14.04
A unifying review of deep and shallow anomaly detection
MySQL service is starting. MySQL service cannot be started. Solution
[leetcode] 16. The sum of the nearest three numbers
《QT+PCL第六章》点云配准icp系列4
[Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication
Go zero actual combat demo (I)
Recommendation of data acquisition tools and detailed graphic process of data acquisition list
Photoshop插件-HDR(二)-脚本开发-PS插件
贝联珠贯加入龙蜥社区,共同促进碳中和
Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
榨汁机UL982测试项目有哪些
Survey of intrusion detection systems:techniques, datasets and challenges