Red Hatã®æ£®è¥ã§ãã
ddãcatã§å¤§ããã®ãã¡ã¤ã«ãæä½ãã¦ãdfã§ãã¡ã¤ã«ã·ã¹ãã ã®çµ±è¨æ å ±ã確èªããç°¡åãªå®é¨ããã¾ãã
(注æ: 諸æ¡ä»¶ã«ãããæå ã§åãæä½ããã¦ãåç¾ããªãå ´åãããã¾ã)
## 1GBã®ãã¡ã¤ã«hogeãä½ãã¾ã # dd if=/dev/zero of=/hoge bs=1GiB count=1 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.474922 s, 2.3 GB/s # df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_rhel84-root 17G 7.2G 9.9G 42% / ## catã§åãå 容ã®ãã¡ã¤ã«hugaãä½ãã¾ãã # cat hoge > huga # df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_rhel84-root 17G 8.2G 8.9G 48% / ## catã§ãã¡ã¤ã«hugaã®æ«å°¾ã«1GB追è¨ãã¾ãã # cat hoge >> huga # df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_rhel84-root 17G 11G 6.9G 60% / ## â 1GBããæ¶è²»ããªãã¯ããªã®ã«2GBæ¶è²»ããã¦ãã¾ã ## catã§ããã«ãã¡ã¤ã«hugaã®æ«å°¾ã«1GB追è¨ãã¾ãã # cat hoge >> huga # df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_rhel84-root 17G 11G 6.9G 60% / ## â ä»åº¦ã¯ä½¿ç¨éãå¤ããã¾ããã§ãã
äºæ³å¤ã®åä½ã ã¨ãã人ãå¤ããã¨æãã¾ãã
ãã¡ã¤ã«ã®ãã©ã°ã¡ã³ãã¼ã·ã§ã³
æ¬é¡ã«å ¥ãåã«åæç¥èã§ãã
ä¼çµ±çãªãã¡ã¤ã«ã·ã¹ãã ã®ä»äºã¨ãã¦ããã¡ã¤ã«ã®ãã©ã°ã¡ã³ãã¼ã·ã§ã³ãäºé²ãããã¨ãããã¾ãã ãã¡ã¤ã«ã®ãã©ã°ã¡ã³ãã¼ã·ã§ã³ã¨ã¯1ã¤ã®ãã¡ã¤ã«ããããã¯ããã¤ã¹ä¸ã§ãã©ãã©ã®ä½ç½®ã«é ç½®ããããã¨ã§ã ç¹ã«ãã¼ããã£ã¹ã¯ã§ã¯ãã¡ã¤ã«ã®èªã¿æ¸ãã®ããã©ã¼ãã³ã¹ã«å¤§ããªå½±é¿ãããã¾ãã (è¿å¹´ã¯NVMe ãSSDã®æ®åã«ãã£ã¦å½±é¿ãå°ãããªã£ã¦ãã¾ãã)
ãã©ã°ã¡ã³ãã¼ã·ã§ã³ã®éã«ããã¡ã¤ã«ããããã¯ããã¤ã¹ä¸ã§é£ç¶ãã¦é ç½®ã§ããã¨ãè¯ããã¨ãããã¾ãã
- ãã¨ã§åç §ã»æ´æ°ããã¨ãã«é£ç¶ã§ã¢ã¯ã»ã¹ã§ããã®ã§éã
- ãã¡ã¤ã«å ã®ã©ãã®ãã¼ã¿ããããã¯ããã¤ã¹ä¸ã®ã©ãã«ãããã®å¯¾å¿é¢ä¿ã管çãããã¼ã¿ãå°ãªãã¦æ¸ã
ãã®ãããªèæ¯ããããã¡ã¤ã«ã·ã¹ãã ã«ã¯ãã¡ã¤ã«ã®ãã©ã°ã¡ã³ãã¼ã·ã§ã³ãäºé²ããããã®å·¥å¤«ãå«ã¾ãã¦ãã¾ãã
XFSã®speculative preallocation
RHELã®ããã©ã«ãã®ãã¡ã¤ã«ã·ã¹ãã ã§ããXFSã«ã¯ãã©ã°ã¡ã³ãã¼ã·ã§ã³ãäºé²ããããã®ä»çµã¿ã¨ã㦠speculative preallocation(ç´è¨³ãã㨠"ææ©çãªäºåå²ãå½ã¦")ã¨å¼ã°ããæ©è½ãããã¾ãã ä»çµã¿ã¯ç°¡åã§ããã¡ã¤ã«æ«å°¾ã¸ã®æ¸ãè¾¼ã¿ãå¥æ©ã¨ãã¦æ¬æ¥å¿ è¦ãªãã¡ã¤ã«æ«å°¾ã¾ã§ãæ ¼ç´ãããããã¯ãã ãã¨ã®é£ç¶ãããããã¯ãããããããã¡ã¤ã«ã«å²ããã¦ã¾ãã ããåããã¡ã¤ã«ã¸è¿½è¨ããã¨ãå²ããã¦ããããããã¯ãå©ç¨ããã¾ãã å²ããã¦ããããã¯ã¯ããã©ã«ãã§5åé使ãããªããã°ååããã¾ãã
ããã»ã©ã¨åãå®é¨ããã¦ãæ¶è²»ã1GBå¢ããã¯ãã2GBå¢ããã¨ãã«ãã¡ã¤ã«ã®ç¶æ ãstatã§è¦ã¦ã¿ã¾ãã
## ãã¡ã¤ã« huga 㯠2GBã512ãã¤ãã®ãããã¯ã 4194304 åã®ã¯ãã 6291584åå²ããã¦ããã¦ãã # stat huga File: huga Size: 2147483648 Blocks: 6291584 IO Block: 4096 regular file Device: fd00h/64768d Inode: 1256334 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Context: unconfined_u:object_r:etc_runtime_t:s0 Access: 2022-11-23 05:51:54.801681431 +0900 Modify: 2022-11-23 05:52:02.397067737 +0900 Change: 2022-11-23 05:52:02.397067737 +0900 Birth: - ## ãã°ããå¾ ã£ã¦ããstatãã㨠Block ãæ¸ã£ã¦ãã # stat huga File: huga Size: 2147483648 Blocks: 4194304 IO Block: 4096 regular file Device: fd00h/64768d Inode: 1256334 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Context: unconfined_u:object_r:etc_runtime_t:s0 Access: 2022-11-23 05:51:54.801681431 +0900 Modify: 2022-11-23 05:52:02.397067737 +0900 Change: 2022-11-23 05:52:02.397067737 +0900 Birth: -
speculative preallocationã¯æ§ã ãªã³ãã³ããå¼ã³åºãã·ã§ã«ã¹ã¯ãªããããã°ã®åºåãªã©ã§ã¿ãããã ããã¡ã¤ã«ãopenãæ«å°¾ã¸åºåããã¡ã¤ã«ãcloseããéæ¬ çã«è¤æ°ã®ããã»ã¹ããç¹°ãè¿ããã¿ã¼ã³ã«ãã¾ã対å¿ãã¾ãã ããããã確ä¿ãããµã¤ãºã¯ãã¡ã¤ã«å®¹éã«ãã£ã¦èª¿æ´ããããã¡ã¤ã«ã·ã¹ãã å ¨ä½ã®ç©ºã容éãèæ ®ããã¾ãã
speculative preallocationã®å¶é
ãã¡ã¤ã«ã·ã¹ãã ã®çµ±è¨æ å ±ãå ã«ä½ããã®å¦çããããªãããã°ã©ã ã speculative preallocationã«ãã¾ã対å¿ã§ããªãå ´åãããã¾ãã ãã®ãããªå ´å speculative preallocationãç¦æ¢ãããã¨ã¯ã§ãã¾ãããã ããããã確ä¿ãããµã¤ãºãå°ãããã¦å½±é¿ãå°ãããããã¨ãã§ãã¾ãã
XFSã®ãã¦ã³ããªãã·ã§ã³ allocsize= ã§speculative preallocationã®ãµã¤ãºãæå®ã§ãã¾ãã
## fstabã®ä¾ /dev/mapper/rhel_rhel84-root / xfs defaults,allocsize=64k 0 0
ã¾ã¨ã
XFSã«ã¯ç¬ç¹ãªå·¥å¤«ããããçµ±è¨æ å ±ãè¦ã¦ããã¨ã³ã£ãããããã¨ãããã¾ãã ã»ã¨ãã©ã®å ´åã«å®³ã¯ããã¾ããããåé¡ãããå ´åã«ã¯å¶éãããããã¨ãã§ãã¾ãã
é¢é£ãªã³ã¯
linux kernelã®xfsããã¥ã¡ã³ã mjmwired.net
RHELã®ãã¬ãã¸è¨äº access.redhat.com