does it seem that kernel cache has been removed from data replication?
does it seem that kernel cache has been removed from data replication?
two are not the same concept.
Direct IO corresponds to Buffer IO.
Direct IO is to submit the IO request directly to the underlying IO device without caching.
Buffer IO means that the IO request is cached by the subsystem, such as the VFS Cache layer on Linux.
write data is first written to memory and then returned, without waiting for the data to be brushed to disk.
read data will first try to read from memory, if the memory hit, there is no need to read from disk.
Buffer IO brings a significant improvement in read and write performance, which is the same concept as adding a Memcached in front of the database.
, Buffer IO is the best choice in most scenarios.
We may need to consider Direct IO:
in the following casesand memory mapping is another big concept, expansion will have a lot of content; If you only look at the part of the file IO, accessing the file through Linux mmap is actually a piece of memory allocated by the application, which directly acts as the cache in the process of reading and writing the file, which can be accessed directly by the user mode, instead of copying the buffer of the user mode to the cache allocated by the kernel like the normal read/write mode, the essence of which is that buffer IO, only saves the copying overhead from the user mode to the kernel mode.