简体   繁体   English

Linux 中的磁盘写入缓冲区大小

[英]disk write buffer size in Linux

如何在 Linux 中找到磁盘写入缓冲区大小?

write system call normally just copies your data to the page cache, which later on gets flushed to the disk. write系统调用通常只是将您的数据复制到页面缓存,然后将其刷新到磁盘。 The size of the page cache is dynamic, the kernel tries to use all free memory for it.页缓存的大小是动态的,内核会尝试为它使用所有可用内存。

See The Page Cache and Page Writeback for more details.有关更多详细信息,请参阅页面缓存和页面回写

Data stored in buffer while you copy file for example to USB is in "Dirty" memory.将文件复制到 USB 时存储在缓冲区中的数据位于“脏”内存中。

Try mount your USB flash disk and #pv file.5GB.. > /media/.../diskname/ it goes quickly and after while hang.. because it fill the buffer in dirty memory尝试挂载您的 USB 闪存盘和 #pv file.5GB.. > /media/.../diskname/ 它会在挂起后快速运行.. 因为它填充了脏内存中的缓冲区

in another terminal #cat /proc/meminfo |在另一个终端 #cat /proc/meminfo | grep Dirty Dirty memory take a lot of space. grep Dirty Dirty 内存占用大量空间。 pv raises transfer to 100% and hangs.. Dirty memory take maximum amount and then slowly goes to zero. pv 将传输提高到 100% 并挂起。脏内存占用最大数量,然后慢慢变为零。 When it happen, pv ends succesfully.当它发生时,pv 成功结束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM