disk io and the use of GFS2

First, to investigate a problem, a write IO process, and what even completed once the IO operation.

"Disk Caches , disk cache.
The data on the disk cache in memory, speed reading and writing files. In fact, in general, the Read / is only dealing with the Write cache. (Of course, there are special circumstances. Below . will talk)
the read to read data directly from the cache if the data to be read is not in the cache, read the disk operation is triggered once, and then wait for the data to be updated on disk-to-disk cache.;
write buffer is written directly to go, then you do not have control. Follow the kernel will be responsible for writing the data back to disk.
Since the disk cache provides caching mechanism will help improve the efficiency of reading and writing, why should it use O_DIRECT option to bypass it?
Under normal circumstances, this application will maintain their own state in the user-specific caching a more conducive application uses,
To replace the disk cache provided by the kernel of this generic caching mechanism. "
 
Second, GFS2 uses a disk cache yet?

Like other GFS2 file system is used as a cache.

2.5.2. VFS Tuning Options: Research and Experiment

Like all Linux file systems, GFS2 sits on top of a layer called the virtual file system (VFS). You can tune the VFS layer to improve underlying GFS2 performance by using the sysctl(8) command. For example, the values for dirty_background_ratio and vfs_cache_pressure may be adjusted depending on your situation. To fetch the current values, use the following commands:
# sysctl -n vm.dirty_background_ratio
# sysctl -n vm.vfs_cache_pressure
The following commands adjust the values:
# sysctl -w vm.dirty_background_ratio=20
# sysctl -w vm.vfs_cache_pressure=500
You can permanently change the values of these parameters by editing the /etc/sysctl.conf file.
 
 
Comprehensive above two issues, GFS2 using the cache when data is being written to unplug the network cable machine, the virtual IP drift to the other machine. However, unplug the network cable machine is still write data, the new machines are taking over writing data.
When you plug the Internet line, the data on both nodes inconsistent. This is just the analysis concluded, need to test validation.
 
FYI:
Written in two ways: Write Through and Write back
 
Check the disk-write method:
# hdparm -W /dev/sda

/ Dev / sda:
 write-caching =  1 (on)
# hdparm -W0 /dev/sda

/ Dev / sda:
 setting drive write-caching to 0 (off)
 write-caching =  0 (off)
# hdparm -W /dev/sda

/ Dev / sda:
 write-caching =  0 (off)
 

Guess you like

Origin www.cnblogs.com/longchang/p/11096241.html