ã¦ã¼ã¶ã®ææ ã«ä½ç¨ããé 延æ¸ãè¾¼ã¿ã®ä»çµã¿ãæ´ã - è¨äºç´¹ä»: Inside Vista SP1 File Copy Improvements (3)
éå»ã®é¢é£è¨äº
ååè¨äº
- è¨äºç´¹ä»: Inside Vista SP1 File Copy Improvements (1)
- è¨äºç´¹ä»: Inside Vista SP1 File Copy Improvements (2)
ããã§ã¯ããããæçµåã«ãã¦ã¡ã¤ã³ãã£ãã·ã¥ï¼è¨äºç´¹ä»ããé¢ãã¦ãã®ä»¶ãæ·±ãæãä¸ãã¦ããã¾ãï¼
Cached I/O vs Non-Cached I/O revisit
Cached I/O ããªã¼ããè»ã«å©ãããªãï¼Non-Cached I/O ã¯ã¾ãã«ããã¥ã¢ã«è»ã§ãï¼
両è
ã®å¤§ããªéãã¯ï¼ã©ããããã®ãµã¤ãºã®ãã¼ã¿ãï¼ã©ããããã®æéã¡ã¢ãªä¸ã«ä¿æããããèªåã§æ±ºãããæåã§æ±ºãããã¨ããã¨ããã§ãï¼ãã¡ããå¾è
ã®æ¹ããçæ³çãªç¶æ³ãã§ã®ããã©ã¼ãã³ã¹ã¯ä¸ã«ãªãã¾ãï¼ä¼¼ããããªå¯¾ç«è»¸ã¯ãã¡ãã¡ã«ããã¾ããï¼
Cached I/O | Non-Cached I/O |
åç §åä½ãã¾ããã§å¯¿å½ç®¡ç㯠GC ã«ãä»»ã | å¤åé åã§å¯¿å½ç®¡çã¯èªåå®è£ |
DrawUserPrimitive | DrawPrimitive |
D3DPOOL_MANAGED | D3DPOOL_DEFAULT |
ãã§ï¼ãããªè«æãããã®ã§ããï¼
second author ã«æ³¨ç®ï¼RDBMS çã®å¤§å¾¡æã«ãã¦ï¼Microsoft Research ã® Jim Gray å士*1ã§ãï¼ãªãæ°ã .NET ã®è«æãï¼ ã¨ããæ¹ã¯è»½ãè«æã®ã°ã©ããçºãã¦ã¿ã¦ä¸ããï¼åºæ¬çã«ãã®è«æ㯠Windows OS 㧠Cached I/O 㨠Non-Cached I/O ã®ããã©ã¼ãã³ã¹ãæ¯ã¹ã話ã§ãï¼.NET ã P/Invoke ã®è©±ã¯ååãã¾ãã£ã½ãã§ããï¼
ä½è«ã§ãã Microsoft SQL Server ã¨ãã製åã¯é¢ç½ãã¦ï¼Non-Cached I/O ã Scatter/Gather I/Oï¼Fiber, NUMA ãªã©é常ã«ç¹æ®ãª API ããããã«æ´»ç¨ãã¦ãã¾ãï¼ããã MSSQL Server ãã¼ã ããã®è¦è«ã§ãããã® OS ã®æ©è½è¿½å ãå¾æ¼ããããã¨ããè¦æ¹ããã§ããããããã¾ããï¼
ãã¦ï¼è«æã®è©±ã«æ»ãã¾ãããï¼
As shown in Figures 6 and 7, a file striped across 16 disk drives delivers 800 MBps and uses about 30% of a processor – when those experiments are done with buffered IO the speed is dramatically less – about 100 MBps vs 800 MBps – so for now, the .NET runtime is OK for single disks, but un-buffered IO is needed to drive disk arrays at speed..
Non-cached I/O ãªã CPU 使ç¨ç 30% 㧠800 MBps åºã¦ããç°å¢ã§ï¼(.NET ã®FileStream ã¯ã©ã¹ã®ãããã¡ãå«ãã) cached I/O ã使ã㨠100 MBps ããåºã¾ããã§ããï¼ã¨ãã話ã§ãï¼
ãã®è©±ã¨ï¼ãå¾æ¥ã® Windows ã®ãã¡ã¤ã«ã³ãã¼ã¯ cached I/O ã使ã£ã¦ãããã¨ãã話ãçµã¿åãããã¨ï¼ãVista 㧠Non-cached I/O ã«ç§»è¡ãã¾ããã¨èãã¦ãããã»ã©é©ãã¯ããªãã§ãããï¼
ãããç¾å®ã«ã©ããªã£ããã¨ããã¨ï¼ç¢ºãã«ç§»è¡ã¯ããã®ã§ããï¼æå¾
ã¯çµ¶æã«å¤ããã¾ããï¼ç§ãå«ãå¤ãã®äººã
ã«ã¨ã£ã¦ã®å°è±¡ã¯ãVista ã®ãã¡ã¤ã«ã³ãã¼ã¯é常ã«é
ããªã£ããã¨ãããã®ã ã£ãã®ã§ãï¼
ãã£ã¨ãï¼è¤æ°ã®ã·ããªãªãç·åçã«è¨æ¸¬ãã¦ï¼æ¬å½ã«ãVista ã®ãã¡ã¤ã«ã³ãã¼ã¯é常ã«é
ããªã£ããã©ãããã調ã¹ã人ã¯å°ãªãã®ã§ã¯ãªãã§ããããï¼ããç¹å®ã®ã·ããªãªï¼ä¾ãã°è¤æ°ã®ãã¡ã¤ã«ããããã¯ã¼ã¯è¶ãã«åã£ã¦ããï¼ã¨ãã£ãã±ã¼ã¹ã§ï¼ä»¥åããããã¤ã¢ãã°ã®ä¼¸ã³ãé
ãã®ã«æ°ãã¤ãï¼ãã®æªå°è±¡ããå
¨ã¦ã®ãã¡ã¤ã«ãµã¤ãºï¼å
¨ã¦ã®ã³ãã¼ã·ããªãªã§ãã£ã¨é
ãã«éããªããã¨ãã確信ã«ç¹ãã£ã人ãå°ãªããªãã¯ãã§ãï¼
ããã¯å
¨ããã£ã¦ææ
çãªåå¿ã§ãï¼ãããã ããããï¼Joel ãããã»ã©å£ãé
¸ã£ã±ããã¦è¦åãã¦ããã®ã§ãããï¼ç¾å¨ã®ã½ããã¦ã§ã¢å¶ä½ã§ã¯ï¼å¶ä½è
ã¨å©ç¨è
ãå
¨ã¦ã®é¢ã§ç°ãªãå ´åãã»ã¨ãã©ã§ãï¼æ
ã«ï¼èª°ããã®ã½ããã¦ã§ã¢ã使ç¨ãï¼ãã®ã¨ãã«ã©ããªææ
ãæ±ããã¨ããè¦ç´ ã¯æ±ºãã¦ç¡è¦ã§ãããã®ã§ã¯ããã¾ããï¼
ç¾å®ã¯äºæ³ã®æãä¸ãè¡ã
ã¾ãï¼ç¾å®ã®å¤æ§æ§ã¨ããæå³ã§ããã®ä»¶ã¯é¢ç½ããã®ã§ããï¼ä¸è¦ããããã¦ããããã§ï¼ãããå®ã¯ãã¾ãè¡ã£ã¦ãããã¨ãããï¼ã¨ããããã§ãï¼
æè¡è :ããããã 1 TB ã®ãã¼ããã£ã¹ã¯ãï¼1 GB ã®ç©ºãã¡ã¢ãªã§ãã£ãã·ã¥ããã¨ãããï¼é¸ã¹ããã¼ã¿ã¯å ¨ä½ã® 0.1 % ããç¡ããã ï¼ãããªè²´éãªãã£ãã·ã¥é åãï¼åã«ä» æ°ç¾ MB ãã æ° GB ã®ãã¡ã¤ã«ãã³ãã¼ãã¦ããããã¨ããçç±ã§ä¸¸ã æ¸ãæãã¦ãã¾ãªãã¦ï¼ã¾ãã«ãã£ãã·ã¥ã®æ±æã ããï¼ã
æªé:ãæ¬å½ã«ããããªï¼ 確ãã«ãã¡ã¤ã«ã³ãã¼ç´å¾ã®ãã¡ã¤ã«ãéããã¨ã¯å°ãªãããã«æãããããããªãããã©ï¼ä¾ãã°ãã¹ã¯ãããã«ãã¡ã¤ã«ãã³ãã¼ããã¨ãã®ãã¨ãèãã¦ã¿ãªãï¼ã ã£ã¦ãã¹ã¯ãããã«æ°ãããã¡ã¤ã«ãç¾ããã¨ï¼ãã¹ã¯ããããµã¼ãã®ã¤ã³ããã¯ã¹ä½æãå§ã¾ã£ã¦ï¼ã¢ã³ãã¦ã£ã«ã¹ã½ãããã¢ã³ãã¹ãã¤ã¦ã§ã¢ã½ãããã¹ãã£ã³ãå§ãã¦ï¼Explorer ã¯è¦ªãã©ã«ãã®ãã©ã«ãã¢ã¤ã³ã³ã«è¡¨ç¤ºãããµã ãã¤ã«ã®ä½æãå§ãããã ãï¼ã
ãã¡ã®æ¥è¨ããã£ã¨ãããã話ã°ããæ¸ãã¦ããã®ã§ï¼ä»åã®ä»¶ãªããã¯æ¬å½ã«èº«ã®ããããããªè©±ã§ãï¼
ã·ã¹ãã ã¨ãã¦ã®è¤éãã¨ï¼åã¨ãã¦ã®åç´ã
ä¾ãã° ZDNet ã®è¨äºã«å¯¾ããåå¿ï¼
ããæå³ã·ã§ããã³ã°ã
XPã§ã¯ãã£ãã·ã¥ã®ã³ããããå¾ ã¡ç¶æ ã§ãã£ã¦ããã¤ã¢ãã°ãæ¶ãã Vistaã§ã¯ãã£ãã·ã¥ããã£ã¹ã¯ã«ã³ããããããæç¹ã§ãã¡ã¤ã«ã³ãã¼ã®çµéã示ããã¤ã¢ãã°ããã¯ã¹ãæ¶ããã¤ã¾ããXPã¯å¦çãéä¸ã¾ã§ããã ãããã¤ã¢ãã°ãæ¶ãã¡ããã®ã§ããã®ããã§XPãéãè¦ãã¦ãã¨ãVistaããªãã§ãããã§ãæªãããã§ã¯ãªãããã§ãã
確ãã«æ®éããæãã¾ãããï¼ç§ãæåè¨äºãèªãã ã¨ãã¯ï¼ããã¼ãï¼ãªãã¦ã¤ã³ããããã¦ãããã ãã¨æãã¾ããï¼ãï¼å®é¨ãã¦ã¿ãã¨â¦â¦ï¼ ç¶ãã¯ãã¨ã®æ¹ã§ï¼
ãã¦ï¼ããããã¯ææ
ã§ã¯ãªãç¾å®ã®æåã®æ¹ã«åã³ç®ãåãã¾ãï¼
ç¾å®ã¯è¤éã ã¨å
ã»ã©æ¸ãã¾ãããï¼é¢ç½ããã®ã§ï¼æ³¨ææ·±ãå®é¨ããã¨ï¼åã
ã®ã¢ã«ã´ãªãºã ã®æ¯ãèããè¦ãã¦ãã¦ï¼ãã°ãã°ããã¯ããã¥ã¡ã³ãéãã®é常ã«ç´ ç´ãªåãã ã£ãããã¾ãï¼
ãã®é©ãã¯ä»¥åã®ã¨ã³ããªã§ãæ¸ããããããã¾ããï¼å¤§éã®ãã¼ããæ¶è²»ããã¢ããªã±ã¼ã·ã§ã³ãæå°åãããï¼ãã®ç´å¾ãããã¼ã¸ãã¡ã¤ã«ã¨ã®åæãå§ã¾ãã¨ãã話ã§ããï¼ç§èªèº«ï¼è©¦ãã¾ã§ã¯ããããªåç´ã«åãã¦ããããããªï¼ãã£ã¨è¤éãªã¢ã«ã´ãªãºã 使ã£ã¦ãããããªãã®ï¼ãã¨æã£ã¦ããã®ã§ãï¼ã¨ãããå®é試ãã¦ã¿ãã¨ï¼ãã¤ã³ãµã¤ã Windows 第4çãã®å
容ããäºæ³ãããåä½ãã®ãã®ã§ï¼éã«ãã»ãã¨ãããªãã¨çããããªã£ã¦ãã¾ããããã§ããï¼
ãã¤ã³ãã¯ããã«ããã¾ãï¼ç¢ºãã«ï¼ã·ã¹ãã å
¨ä½ã¨ãã¦ã®ããã©ã¼ãã³ã¹ãï¼ãã®ããã©ã¼ãã³ã¹ãã©ã®ãããªææ
ãå©ç¨è
ã«æ±ããããã¯ï¼é常ã«è¤éãªåé¡ã§ãï¼äºåã«èªã¿åãã®ã¯ã¨ã¦ã大å¤ã§ãï¼Microsoft ã§ããããããã¾ãï¼ãããï¼ãããªè¤éãªã·ã¹ãã ã§ãï¼é¨åé¨åã¯ï¼ããã»ã©è¤éãªä»çµã¿ã§åãã¦ãã訳ã§ã¯ãªãã®ã§ãï¼
ããã¦ï¼Windows ãæ§æããåã
ã®ã³ã³ãã¼ãã³ãã®æ¯ãèãã«ã¤ãã¦ã®è³æã¯æ¢ãã°çµæ§ãããã®ã§ãï¼ããã¥ã¡ã³ããå
¬éããã¦ãã以ä¸ï¼ã½ã¼ã¹ã³ã¼ããå
¬éããã¦ããªããã¨ã¯è¨ã訳ã«ã¯ãªãã¾ããï¼å¿
è¦ãªã³ã¹ãããããã°ï¼éå®ãããç¯å²å
ã§ã®åä½æ¨å®ã¯ããªãã®é«ç²¾åº¦ã§å¯è½ã§ãï¼ããã¯éæ³ã§ã¯ãªãã¦æè¡ã§ãï¼ããã®ã¨ããã¯ããæ¶ãã¦ããã¾ãããï¼
確ãã«é£æ度ã¯æ¥µæªã§ãï¼æªæã«åºã¥ããã¨ããæããªãå¶ç¶ã¨éå»ãæãéãªãï¼ä¼èã§ä¼ãã£ã¦ããæ
å ±ã¯ãã¹ãªã¼ããèªãã©ã³ãã ãã¤ãºï¼
ããããããªæèè¿·è·¯ãï¼é常ãã¢ããè£ã«åã£ã¦ã¿ãã¨ï¼æ¡å¤ãããããã¨ã®ãªãå¼µãã¼ã¦ã ã£ãããããã®ã§ãï¼ããã§ã¯è§£ããããããï¼
é 延æ¸ãè¾¼ã¿å ¥é
ã¨ããããã§ä»åã¯ï¼Cached I/O ã«ããé
延æ¸ãè¾¼ã¿ã«çµã£ã¦ï¼æ®æ®µã¯ãã¾ã表ã«ãããããªãèå°è£ãã覧ã«ããã¾ãããï¼æå¾ã¾ã§èªãã§ããã ããã°ï¼å°ãªãã¨ãå³æ»ã³ã³ããé£ãããªãç¨åº¦ã«ã¯èæ§ãä»ãã¯ãã§ãï¼
åèè³æã¨ãã¦ã¯ï¼æ¬¡ã®ãã®ããå§ãã§ãï¼
- ãã¤ã³ãµã¤ã Windows 第4çãã®ã 第11ç« ãã£ãã·ã¥ããã¼ã¸ã£ã
- 以åæ±å¤§ã§è¡ããããコンピュータ科学特別講義III (戦略ソフトウェア特論II) ãã¨ããè¬ç¾© ã®ãCacheManager に関する講義資料ã
WriteFile ãé
延æ¸ãè¾¼ã¿ãè¡ãã¨ãï¼å¼æ°ã«æ¸¡ããããã¼ã¿ãåã«ãã¡ã¤ã«ãããã³ã°ãããç©çã¡ã¢ãªã«ã³ãã¼ãããã ãã§ï¼å®éã®ãã¡ã¤ã«æ¸ãè¾¼ã¿ã¯å®äºãã¦ãã¾ããï¼ã¾ãã¯ãããåç¾ãã¾ãï¼
次ã®ãããªãã¹ãã³ã¼ãããã¹ã¿ã¼ããã¾ãããï¼ããã¯ï¼
- CreateFile API ã使ç¨ãã¦ã·ã¹ãã ãã©ã¤ãã«ãã¡ã¤ã«ãæ°è¦ä½æï¼
- ããã©ã«ãã®ã¾ã¾ãªã®ã§ Cached I/O ã使ç¨ãããã¨ã«ãªãï¼
- 64 KB ã®ãããã¡ã VirtualAlloc ã§ç¢ºä¿
- é©å½ã«ãã¼ã¿ãåãã
- WriteFile API ã«å
ã»ã©ã®ãããã¡ã渡ãã¦ãã¼ã¿ãæ¸ãè¾¼ã
- ããã 128 åç¹°ãè¿ã
- åè¨ 8 MB æ¸ãè¾¼ã¾ãã
- CloseHandle ã§ãã¡ã¤ã«ãéãã¦çµäºãã
ã¨ãããã®ã§ãï¼
æå
ã®ç°å¢ã§ï¼WriteFile 128 åã«è¦ããæéãè¨ã£ã¦ã¿ã¾ããï¼æè¦æéã¯ç´ 10 msec åå¾ã§ï¼WriteFile ã®ã¹ã«ã¼ãããã¯ç´ 800 MB/sec ã«ç¸å½ãã¾ãï¼ããã«ï¼CPU ã®åä½ã¯ããã¯ãååã«ãã¦è©¦ãã¦ã¿ãã¨ï¼æ¦ãæè¦æé㯠2 åã«ï¼ã¤ã¾ãã¹ã«ã¼ãããã¯ååã® 400 MB/sec åå¾ã¨ãªãã¾ããï¼ãããçã®ãã£ã¹ã¯é度ã¨ã¯ã¨ã¦ãæãã¾ããããï¼ HDD èªä½ã«æè¼ããã¦ãããã£ãã·ã¥ã¡ã¢ãªãçãã®ã§ããã°ï¼ä»ã®ãã£ã¹ã¯ã§è©¦ãã¦ã¿ãã¨ããã§ãããï¼ãªãï¼å®éã«ãã£ã¹ã¯ã«æ¸ãè¾¼ã¾ããã¾ã§åæçã«å¾
ã¤ãã¨ãå¯è½ã§ï¼ããã«ã¯ FlushFileBuffers API ã使ç¨ãã¾ãï¼FlushFileBuffers ã«ãããæéããï¼ã©ããããé
延æ¸ãè¾¼ã¿ãæºã¾ã£ã¦ããã®ãè¦ç©ãããã¨ãå¯è½ã§ãï¼
æ¹ãã¦ã½ã¼ã¹ã³ã¼ãã示ãã¾ãããï¼
#define WINVER 0x500 #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <iostream> #include <fstream> int main() { HANDLE file = ::CreateFileW( L"C:\\test.dat", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL); const int totalSize = 1024*1024*8; const int bufSize = 1024*64; char* buf = (char*)VirtualAlloc(NULL, bufSize, MEM_COMMIT, PAGE_READWRITE); for(int i = 0; i < bufSize; ++i) { buf[i] = i % 255; } int numWriteBytes = 0; for(int i = 0; i < totalSize/bufSize; ++i) { DWORD size = 0; const BOOL ret = WriteFile( file, buf, bufSize, &size, NULL ); if( ret == 0 ) { const DWORD lastError = GetLastError(); std::cout << "WriteFile failed error:" << lastError << std::endl; break; } numWriteBytes += size; } CloseHandle(file); VirtualFree(buf, 0, MEM_FREE); return 0; }
ã±ã£ã¨è¦ãã ãã§ã¯ï¼ããã¯ããã«ããHDD ã®æ¸ãè¾¼ã¿é度ã®å½±é¿ãåããããªã³ã¼ããã§ãï¼ãï¼ããã¯æ¢ã«æèè¿·è·¯ã®å
¥ãå£ã§ãï¼
æ¢ã«ãã®ã³ã¼ããã»ã¨ãã© CPU ã®ãã³ããã¼ã¯ã«ãªã£ã¦ãã¾ããã¨ãããã®ã¯ç¤ºãã¾ããï¼äºç´°ãªãã¨ããããã¾ãããï¼ã½ã¼ã¹ã³ã¼ãã« FlushFileBuffers API ãã¿ããããªããã¨ãªã©ã«ãæ°ä»ãã¦ããããã¨ããã§ãï¼
ãã®ããã«ï¼ã½ã¼ã¹ã³ã¼ãã®åé¢ããï¼å®éã«ã©ã®ãããªæåãå°ããããï¼ãã®å¯è½æ§ãçå£ã«èãã¦ã¿ãã®ãæ¬ã¨ã³ããªã®è¶£æ¨ã§ãï¼
é 延æ¸ãè¾¼ã¿ã¨ã«ã¼ãã«å¤æ° CcDirtyPageThreshold
å
ã»ã©ã®ãã¹ãã³ã¼ãã§ã¯ï¼åè¨ 8 MB ã®ãã¼ã¿ãé
延æ¸ãè¾¼ã¿ãããã®ãè¦ã¾ããï¼ãã¹ãç°å¢ã® HDD ã®æ¸ãè¾¼ã¿é度ã¯æ¦ã 20 MB/sec ç¨åº¦ãªã®ã§ï¼å
¨åã§æ¸ãè¾¼ã㧠0.4 ç§ç¨åº¦ã®ãã¼ã¿ããã£ãã·ã¥ããã¦ãããã¨ã«ãªãã¾ãï¼
ãã®ãµã¤ãºã¯ã©ãã¾ã§å¢ããã®ã§ããããï¼å®ã¯ï¼ãã£ãã·ã¥ããã¼ã¸ã£ãä¿æã§ãããã¼ãã£ã¼ãã¼ã¸ (ãã£ã¹ã¯ã«æ¸ãè¾¼ã¿ãå®äºãã¦ããªãã¡ã¢ãªãã¼ã¸) ã¯ï¼ã«ã¼ãã«å¤æ° CcDirtyPageThreshold ã¾ã§ã¨å¶éããã¦ãã¾ã*2ï¼
CcDirtyPageThreshold ã¯ï¼æè¼ç©çã¡ã¢ãªéç ã«ãã£ã¦åæåæã«æ±ºå®ãããé¾å¤ã§ï¼ãã£ãã·ã¥ããã¼ã¸ã£ãä¿æã§ãããã¼ãã£ã¼ãã¼ã¸ã®æ大å¤ãç¾ãã¾ãï¼
ãã£ãã·ã¥ããã¼ã¸ã£ãä¿æãã¦ããã·ã¹ãã å
¨ä½ã®ãã¼ãã£ã¼ãã¼ã¸ã CcDirtyPageThreshold ãè¶
ãããã«ãªãã¨ï¼WriteFile API å¼ã³åºããå
é¨ã§ãããã¯ãããããã«ãªãã¾ã*3ï¼ãã¼ãã£ã¼ãã¼ã¸ã®æ¸å°é度ã¯ï¼HDD ã®æ¬å½ã®æ¸ãè¾¼ã¿é度ãè¶
ãããã¾ããããï¼ãã以éï¼å¹³åã®æ¸ãè¾¼ã¿é度㯠HDD ã®å®éã®æ¸ãè¾¼ã¿é度ã¨ã»ã¼ä¸è´ããã¨äºæ³ããã¾ãï¼
試ãã« CcDirtyPageThreshold ã 510 MB ã¨ããç°å¢ã§å®é¨ãã¦ã¿ã¾ããï¼Cached I/O ã¢ã¼ã㧠64 KB ã® WriteFile ãç¹°ãè¿ãï¼æ¸ãåºããåè¨éã¨æè¦æéã®é¢ä¿ã測å®ããªããï¼åè¨ 1 GB ã¾ã§æ¸ãè¾¼ãã§ã¿ãã¨ãããã®ã§ãï¼
çµæãä¸ã«ç¤ºãã¾ãããï¼é¢ç½ããããã« 510 MB ã¡ãã£ã¨ã®ã¨ããã§ãã¢ã¼ããå¤ãã£ã¦ãããã§ãããï¼ ååã®æ¸ãè¾¼ã¿ããçµãããã¾ã§ç´ 1.5 ç§ï¼ãã®å¾ç´ 50 ç§ããã¦å¾åã®æ¸ãè¾¼ã¿ããçµãããã¾ãï¼ããããã£ã¹ã¯ã¯ã¾ã æ¸ãè¾¼ã¿ãç¶ãã¦ããã¨ï¼å
¨ã¦ãçµã¿åãããã°ç«æ´¾ãªæèè¿·è·¯ã®ã§ããããã§ãï¼
ãã¡ãããã®ã°ã©ãã®å§ç¹ã¨çµç¹ãçµã¹ã°å¹³åæ¸ãè¾¼ã¿é度ãåããã¾ãããï¼ã§ãï¼ãããªãã®ã«ï¼ã¯ããã¦ä½ã®æå³ãããã®ã§ããããï¼
å®éã® CcDirtyPageThreshold ã¯ã©ãããããªã®ãï¼
ãã¦ï¼è©±ãæ»ãã¾ãããï¼
ã¤ã¾ããXPã¯å¦çãéä¸ã¾ã§ããã ãããã¤ã¢ãã°ãæ¶ãã¡ããã®ã§ããã®ããã§XPãéãè¦ãã¦ãã¨ãVistaããªãã§ãããã§ãæªãããã§ã¯ãªãããã§ãã
Windows Vista RTM ç以å¤ï¼ã¤ã¾ã Windows XP ãå«ãå¾æ¥ã® Windows ãï¼Windows Vista SP1 ãªã©ã¯ï¼ååçã« Cached I/O ã使ç¨ãã¦ãã¡ã¤ã«ã³ãã¼ãè¡ã£ã¦ãã¾ãããï¼ãã¤ã¢ãã°ãæ¶ããã¿ã¤ãã³ã°ã§ã ããã CcDirtyPageThreshold ã¨åç¨åº¦ã®æªæ¸ãè¾¼ã¿ãã¼ã¿ãã¡ã¢ãªä¸ã«æ®ã£ã¦ããã¨èãããã¾ã (ãã¡ããããã¯ã·ã¹ãã å
¨ä½ã«é©ç¨ãããå¤ãªã®ã§ï¼å¥ããã»ã¹ã Cached I/O ãè¡ã£ã¦ããã°æªæ¸ãè¾¼ã¿ãã¼ã¿ã¯ãã£ã¨å°ãªããªãã¾ã)ï¼ä¸æ¹ã§ï¼Windows Vista RTM çã§ã¯ï¼Non-Cached I/O ã使ã£ã¦ï¼èªåã§ãããã¡ç®¡çãè¡ããªãããã¡ã¤ã«ã³ãã¼ãè¡ãã®ã§ï¼ãã¡ã¤ã«ã³ãã¼ãã¤ã¢ãã°ã®çµäºæã«ã¯åºæ¬çã«å
¨ã¦ã®æ¸ãè¾¼ã¿ãå®äºãã¦ãã¾ãï¼
ãã¦ï¼å®éã® CcDirtyPageThreshold ã®å¤ã¯ã©ãããããªã®ã§ããããï¼ ãã¤ã³ãµã¤ã Windows 第4ç 11.7.3 æ¸ãè¾¼ã¿ã®æå¶ãã«ï¼WinDbg ãç¨ã㦠CcDirtyPageThreshold ã®å¤ã表示ããæ¹æ³ã解説ããã¦ãã¾ãï¼WinDbg ã§ã«ã¼ãã«ãããã°ãéå§ãã¦ï¼!defwrites ã³ãã³ããå®è¡ãã¾ã*4ï¼
以ä¸ã¯æå
ã® Windows Vista SP1 ç°å¢ã§ï¼ 1 GB ã®ãã¡ã¤ã«ãã³ãã¼ããªãã !defwrites ãå®è¡ããã¨ãã®çµæã§ãï¼
"writes may be throttled" ã¨è¡¨ç¤ºããã¦ãã¦ï¼æ¸ãè¾¼ã¿ã®æå¶ãè¡ããã¦ãããã¨ãåããã¾ãï¼
lkd> !defwrites *** Cache Write Throttle Analysis *** GetUlongFromAddress: unable to read from 00000000 GetUlongFromAddress: unable to read from 00000000 CcTotalDirtyPages: 65449 ( 261796 Kb) CcDirtyPageThreshold: 65461 ( 261844 Kb) MmAvailablePages: 180063 ( 720252 Kb) MmThrottleTop: 0 ( 0 Kb) MmThrottleBottom: 0 ( 0 Kb) MmModifiedPageListHead.Total: 75783 ( 303132 Kb) CcTotalDirtyPages within 64 (max charge) pages of the threshold, writes may be throttled Check these thread(s): CcWriteBehind(LazyWriter) Check critical workqueue for the lazy writer, !exqueue 16 Cc Deferred Write list: (CcDeferredWrites) File: 860c22b0 Event: beb6aa98
ããã¤ãç°å¢ã§ CcDirtyPageThreshold ã®å¤ã調ã¹ã¦ã¿ã¾ããï¼
OS | LargeSystemCache | Memory [MB] | CcDirtyPageThreshold [MB] |
---|---|---|---|
XP SP2 (x86) | 0 | 256 | 22 |
XP SP2 (x86) | 0 | 384 | 22 |
XP SP2 (x86) | 0 | 512 | 22 |
XP SP2 (x86) | 0 | 768 | 22 |
XP SP2 (x86) | 0 | 1024 | 22 |
XP SP2 (x86) | 0 | 1536 | 22 |
XP SP2 (x86) | 1 | 256 | 200 |
XP SP2 (x86) | 1 | 384 | 311 |
XP SP2 (x86) | 1 | 512 | 447 |
XP SP2 (x86) | 1 | 768 | 510 |
XP SP2 (x86) | 1 | 1024 | 510 |
XP SP2 (x86) | 1 | 1536 | 510 |
Vista SP1 (x86) | 0 | 512 | 64 |
Vista SP1 (x86) | 0 | 768 | 96 |
Vista SP1 (x86) | 0 | 1024 | 128 |
Vista RTM (x86) | 0 | 1536 | 192 |
Vista SP1 (x86) | 0 | 1536 | 192 |
Vista SP1 (x86) | 0 | 2048 | 256 |
Vista SP1 (x86) | 1 | 512 | 64 |
Vista SP1 (x86) | 1 | 768 | 96 |
Vista SP1 (x86) | 1 | 1024 | 128 |
Vista RTM (x86) | 1 | 1536 | 192 |
Vista SP1 (x86) | 1 | 1536 | 192 |
Vista SP1 (x86) | 1 | 2048 | 256 |
ãªãï¼Windows XP ã® LargeSystemCache ã¯ããã©ã«ã㧠0 ã§ï¼ãã³ã³ãã¥ã¼ã¿ã®ããããã£ãã«ã¦ãããã»ããµã®ã¹ã±ã¸ã¥ã¼ã«ã¨ã¡ã¢ãªä½¿ç¨éãã§ãããã¯ã°ã©ã¦ã³ããµã¼ãã¹åªå
ããã¡ã¢ãªä½¿ç¨éãã§ãã·ã¹ãã ãã£ãã·ã¥ããé¸æãããã¨ã§ã 1 ã«ãªãã¾ãï¼ä¸ã®è¡¨ã«ç¤ºããããã«ï¼æå
ã® Windows Vista SP1 ã§ã¯ï¼LargeSystemCache ã«ãã CcDirtyPageThreshold ã®å¤åã¯è¦ããã¾ããã§ãã*5ï¼
ãã¦ãã¦ï¼ãã® CcDirtyPageThreshold ã®æ°åã®å¤§ããï¼ãããã§ããããï¼
2 GB ã®ã¡ã¢ãªãæè¼ããï¼æå
ã® Windows Vista SP1 ã¯ï¼ã·ã¹ãã ãã£ã¹ã¯ã®å®éã®æ¸ãè¾¼ã¿é度ã 20 MB/sec åå¾ãªã®ã«å¯¾ãã¦ï¼CcDirtyPageThreshold ã¯ç´ 256 MB ã§ãï¼ã¨ãããã¨ã¯ï¼ãã¡ã¤ã«ã³ãã¼ã¯ç´ 13 ç§ããããæ©ããçµäºãã¦ããã®ããããã¾ããï¼ãã¡ãããã®éåé»ãèµ·ããã°æªæ¸ãè¾¼ã¿ã®ãã¼ã¿ã¯æ»äº¡ãªããã§ããï¼
Windows XP SP2 ã§ã¯ã©ãã§ãããï¼ ãã㯠LargeSystemCache ã®å¤ã«ããå¤åã大ãããã¦ï¼åããã¼ãã¦ã§ã¢ã¨ã¯æããªãéããç¾ãã¾ãï¼ã¬ã¸ã¹ããªã¨ã³ããªãã²ã¨ã¤å¤ããã ãã§ï¼1.5 GB ã®ã¡ã¢ãªãæè¼ããªãã 22 MB ã® CcDirtyPageThreshold ã¨ãããã¨ãããã°ï¼768 MB ã®ç°å¢ã® CcDirtyPageThreshold ã 510 MB ã¨ãããã¨ãããããã§ãï¼ãã¡ããï¼æ大 510 MB ã®é
延æ¸ãè¾¼ã¿ã許å¯ãããã¨ãã£ã¦ãï¼å®éã«å
¨ã¦ä½¿ãåãããã©ããã¯ç©ºãã¡ã¢ãªæ¬¡ç¬¬ã§ãï¼çµæã¨ãã¦ï¼ããæ¥ã®ãã¡ã¤ã«ã³ãã¼ã¯ã¨ã¦ãéãæããããããããã¾ãããï¼ããæ¥ã®ãã¡ã¤ã«ã³ãã¼ã¯ HDD æ§è½ã«è¦åã£ãæ®éã®é度ã«æããããããããã¾ããï¼
ãªã Windows Vista RTM ã§ãã¡ã¤ã«ã³ãã¼ã¯é ããªã£ãã®ãï¼
以ä¸ã®ããã«ï¼ããã©ã«ãè¨å®ã® Windows XP SP2 ã® CcDirtyPageThreshold ã¯ååå°ããï¼æ¨æºç㪠HDD ã«ãã¦ããããã 1 ç§ç¨åº¦ã ã£ããã¨ãåããã¾ããï¼ããï¼ä½ãå¤ã§ããï¼å
ã
é
延æ¸ãè¾¼ã¿ã§å¤§ãã¦æéç縮ãèµ·ãã¦ããªãã®ãªãï¼Vista RTM çã§ãã®å¹æã 0 ã«ãªã£ã¦ãå½±é¿ã¯å°ãªãã¯ãã§ãï¼ã¨ããããã§ï¼å人çã¯ãã¯ã Vista RTM çã§ã®ããã¯ãã£ã±ããã¹ã¨å¼ã¹ããã®ã ã£ãããããªãããªã¨æãã¾ãï¼Mark æ°ã®å
è¨äºã§ã¯ï¼ä»ã«ãæ§ã
ãªè¦å ã解説ããã¦ãã¾ãã®ã§ï¼ããå½±é¿ã®å¤§ããã£ãåå ãæ¢ãã«ã¯ãã¡ããè¦ç´ããã¨ã«ãªãã§ãããï¼è©³ããã¯æ¬ã·ãªã¼ãºã®ç¬¬ 1 åã¨ç¬¬ 2 åãã©ããï¼
ãã ãä¾å¤ã¨ãã¦ï¼XP SP2 ç°å¢ã§ LargeSystemCache ã 1 ã«è¨å®ãã¦ãã人ãã¡ããã¾ãï¼å½¼ã㯠XP SP2 æ代ã«ï¼é
延æ¸ãè¾¼ã¿ã§å¤§ããªæéç縮å¹æãå¾ã¦ããå¯è½æ§ãããã¾ãï¼ãããªå½¼ãã Vista RTM ã«ãã¢ããã°ã¬ã¼ãããã¦ãã¾ãã¨ï¼CcDirtyPageThreshold ã«ãã£ã¦å¾ããã¦ããæ°ç¾ MB åä½ã®ä¸é§ã失ã£ããã¨ã§ãããï¼ãã®å ´åã«éãã°ï¼Vista RTM çã§ã¯ 256 KB 以ä¸ã®ãµã¤ãºã®ãã¡ã¤ã«ã³ãã¼ã« Cached I/O ã使ç¨ããªããªã£ããã¨ãï¼ãã¡ã¤ã«ã³ãã¼é度ãä½ä¸ãããã¨ãã説ã¯ã ãã¶ãã£ã¨ããããèããã¾ãï¼
ãããã«ããï¼Vista SP1 ã§å
¨ã¦ã®ãµã¤ãºã®ãã¡ã¤ã«ã³ãã¼ã¯ Cached I/O ã«æ»ãã¾ããï¼å
¨ã¦ã¯å
éãã§ãï¼åã³ CcDirtyPageThreshold ã¯å¸¸ã«ãã¡ã¤ã«ã³ãã¼æéã¸å½±é¿ãåã¼ãããã«ãªãã¾ããï¼ããã¦å¤§å¤æ°ã® XP ã¦ã¼ã¶ã¼ (ã¤ã¾ã LargeSystemCache ã®å¤ãå¤ãã¦ããªã人) ã Vista SP1 ã«ç§»è¡ããã¨ãï¼CcDirtyPageThreshold ã¯å¤§å¹
ã«å¢å ãã¾ãï¼ãã¡ããå®éã®ãã¡ã¤ã«ã³ãã¼ã«ã¯è¤éã§ï¼ã³ãã¼å
ããã®èªã¿åºãé度ãé¢ä¿ãã¦ãã¾ããï¼é
延æ¸ãè¾¼ã¿ã«ãã¦ã常ã«ç©ºãã¡ã¢ãªã¨ã®ç¸è«ã§ãããï¼åç´ã«ã³ãã¼æéãå½±é¿ãåãããã©ããã¯ã±ã¼ã¹ãã¤ã±ã¼ã¹ã§ããã©ï¼
ã¨ã¾ããã¡ã¤ã«ã³ãã¼ã¨ããé常ã«åç´ãªä½æ¥ã²ã¨ã¤ã¨ã£ã¦ã¿ã¦ãï¼ãVista ã«ãã¦éããªã£ããããé
ããªã£ããããå¤ãããªãããã¨ããä¼è©±ãå
¥ãä¹±ããçç±ã®ä¸ç«¯ãè¦ãã¦ããããã§ãï¼åã
ã®ã«ã¼ã«ã¯ã·ã³ãã«ã§ããï¼ç°å¢ã«èµ·å ãããã©ã¡ã¼ã¿ã®çµã¿åããã大ãããã¦ï¼ããã¯ã¡ãã£ã¨ç¥ãªãã¬äººã®æã«ã¯ä½ãããã«æãã¾ãï¼
ä¸çã¯åºãï¼çµã¿åããã¯ç¡éã«è©¦è¡ããç¶ãã¾ãï¼ãã人ã®ç°å¢ã§çºçããçµã¿åããã¯ï¼æ¬å½ã«ãã®å ´éãã®å¥è·¡ã®ãããªçµã¿åããããããã¾ããï¼
ãããã¦ï¼çµ±ä¸çã«ãVista ã¯éããé
ããããèªãã®ã¯ãã¯ãä¸å¯è½ã¨ãããã¨ã«ãªãã¾ãï¼ããããç°å¢ã®å¤æ§æ§ã大ããããã®ãåé¡ãªããã§ãããï¼å¹³åã«æå³ããããã©ããããæªãããã®ã§ãï¼å¤æ§ãªç°å¢ã®å¹³åãåã£ãã¨ãã¦ãï¼ããã§ããªãã®ãç¾å®ãã説æã§ããã§ããããï¼
ææ
ãèæ
®ããã¨ãã観ç¹ã§è¨ãã°ï¼OS ãå«ãããªãããã«ã¯ï¼ãæããã«ããããããã¨æããããããªç®ç«ã£ããããããªããã¨ã«å°½ãã¾ãï¼ãã®ç¹ã§ Vista RTM çã¯å¤§ããªãã¹ãç¯ãã¾ããï¼
ãããã¯ãæããã«ãã¾ããã£ã¦ãããããã«è¦ããä½ããæ°ä»ãããç¨åº¦ã«ããããªã示ãã®ã¯æå³ãããã¾ãï¼SuperFetch ã¯ï¼ä½æã§ããæéå·®ã稼ãåºãããã¨ããç¹ã§ï¼ç§ã®å°è±¡ã¨ãã¦ã¯ãã¾ããã£ã¦ããããã«æãã¾ãï¼ãã ã¾ãä»ã® SuperFetch ã¯ï¼HDD ã®ã¢ã¯ã»ã¹é³ãã¢ã¯ã»ã¹ã©ã³ãã¨ãã¦åä½ãè¦ãã¦ãã¾ãã¾ãããï¼ãããé ãã¦ï¼ã¤ã¾ã SSD ãªã©ã¸ã®ç§»è¡ã§å
ãé³ããªããªã£ã¦ã¯ããã¦ï¼çã«ç©ºæ°ã®ãããªæ©è½ã«æè¯ããããã¨ã§ãããï¼
ãã¹ãé¿ãã¦ï¼ã¯ã³ãã¤ã³ããæ°ä»ãããç¨åº¦ã«ããããªãï¼ããã°ãããã£ã空æ°æãããç¾ä»£ã®ã½ããã¦ã§ã¢ã«æ±ãããã¦ããã®ããããã¾ããï¼
é 延æ¸ãè¾¼ã¿ã確èªãããã®ä»ã®æ¹æ³
ãã£ãã·ã¥ããã¼ã¸ã£ãçµç±ããé
延æ¸ãè¾¼ã¿ã確èªããæã確å®ãªæ¹æ³ã¯ï¼WinDbg ã® !defwrites ã³ãã³ããæå®ãã¦ï¼CcTotalDirtyPages ã«ã¼ãã«å¤æ°ã®å¤ã確èªãããã¨ã§ãï¼ãã®å¤ãææã«å¤§ãããã°ï¼æªæ¸ãè¾¼ã¿ã®ãã¼ã¿ããã£ãã·ã¥ããã¼ã¸ã£ãæ±ãã¦ãããã¨ãåããã¾ãï¼
WriteFile ãè¡ã£ã¦ããã½ã¼ã¹ã³ã¼ããä¿®æ£ã§ããã®ã§ããã®ã§ããã°ï¼FlushFileBuffers API ãå¼ãã§ã¿ãã®ãã²ã¨ã¤ã®æ¹æ³ã§ãï¼FlushFileBuffers ããæ»ãã¾ã§ã«æéããããã°ï¼ããã ãé
延æ¸ãè¾¼ã¿ãæºã¾ã£ã¦ãããã¨ãåããã¾ãï¼
Mark æ°ã®è¨äºã«ãã£ãããã«ï¼Process Monitor ãå©ç¨ãã¦å®éã®æ¸ãè¾¼ã¿ãã¢ãã¿ããã¨ããæ¹æ³ãããã¾ãï¼
ãã®ä»ï¼ããã©ã¼ãã³ã¹ã«ã¦ã³ã¿ãããããç¨åº¦ã®ãã¨ãåããã¾ãï¼
- Cache ã«ãã´ãª
- Lazy Write Flushes/sec
- Lazy Write Pages/sec
- Memory ã«ãã´ãª
- Modified Page List Bytes (Vista 以éã®ã¿)
é 延æ¸ãè¾¼ã¿ã使ããªãã¨ã
ãã¦ï¼ããã¤ãå®é¨ãã¦ãã¦æ°ä»ããã®ã§ããï¼WriteFile API ã«æ¸¡ããããã¡ãµã¤ãºã«ãã£ã¦ï¼WriteFile ãåææ¸ã込㿠(å®éã«ãã£ã¹ã¯ã«æ¸ãè¾¼ãã¾ã§æ»ã£ã¦ããªã) ã«ãªããã¨ãããããã§ãï¼ãã®ãã¨ã«æ°ä»ããªãã¨ï¼ä¸æè°ãªæåã«æ©ã¾ããããã¨ã«ãªãã¾ãï¼
ä¾ãã° WriteFile ã¯ï¼ã«ã¼ãã«ã¢ã¼ãã¸ã®é·ç§»ãä¼´ããããªã®ã§ï¼åæ°ãæ¸ãããæ¹ãããã©ã¼ãã³ã¹ãä¸ããã¨äºæ³ããã¨ãã¾ãããï¼ãã㧠WriteFile ã«æ¸¡ããããã¡ãµã¤ãºã 64 KB ãã 1 MB ã«å¢ããã¦ã¿ã¾ãï¼ãã㧠WriteFile ã®å¼ã³åºãåæ°ã¯ 1/16ï¼ããããã¨æãããï¼1 MB ã®ãããã¡ã渡ããã¨ãã® WriteFile ã¯ï¼é
延æ¸ãè¾¼ã¿ãããªããªã£ã¦ï¼å®éã«ãã©ã¤ãã«ãã¼ã¿ã渡ãããã¾ã§å¦çãæ»ããªãã¾ããã¨ï¼ããã CcDirtyPageThreshold é¢ä¿ãªãã«ï¼ã§ãï¼ãããªãã¨ï¼æ¸ãè¾¼ã¿æéã¯çããªãã©ãããæ°ååãé·ããªã£ã¦ãã¾ãã¾ãï¼ããï¼
ããã¤ãã®å®é¨ããï¼çè
ã®æå
ã®ç°å¢ã§ã¯ 256 KB ã¾ã§ã® WriteFile ã§ããã°é
延æ¸ãè¾¼ã¿ãè¡ãããããããã¨ãåããã¾ããï¼ãã¡ãããã®å¤ã¯ç°å¢ãè¨å®ã«ãã£ã¦ç°ãªãããããã¾ããï¼éè¦ãªã®ã¯ï¼64 KB ã® WriteFile 16 åã¨ï¼1 MB ã® WriteFile 1 åãï¼åãçµæã«ãªãã¨ã¯éããªãã¨ãã¨ã§ãï¼
ããä¸ç¹ã®æ°ä»ãããã¨ã¨è¨ãã°ï¼ãã£ã¹ã¯æ¸ãè¾¼ã¿ããªã·ã¼ã®å½±é¿ã§ãï¼Windows Vista SP1 ç°å¢ã§å®é¨ãã¦ãã¦ï¼USB ãã©ã¤ãã®æ¸ãè¾¼ã¿ããªã·ã¼ã§ãã¯ã¤ãã¯åé¤ã®ããã«æé©åããããé¸ãã§ããã¨ãã®ãã¨ã§ãï¼WriteFile èªä½ã¯é
延æ¸ãè¾¼ã¿ãè¡ã£ã¦ããããã«æ¯ãèãã®ã§ããï¼CloseHandle ã§ãã¡ã¤ã«ãéããã¨ãã« FlushFileBuffers ç¸å½ã®ãã¨ãè¡ã£ã¦ãããããï¼ããããã¡ã¤ã«ãéããã®ã«å¾
ãããããã¨ã«ãªãã¾ãï¼CcDirtyPageThreshold ãæ°ç¾ MB ã¨ããç°å¢ã§ã¯ï¼10 ç§ã©ãããããªãå¾
ãããããã¨ãããï¼ãããç¥ããªãã¨ã³ã£ããã¨ããç¾è±¡ããããã¾ããï¼
ããã CloseHandle ããã«ããã»ã¹ãçµäºãããã©ããªãããå®é¨ãã¦ã¿ã¾ãããï¼çµå±ããã»ã¹ã¯ãªã¼ã³ã¢ããæã«åããã¨ãè¡ãããããã§ï¼10 ç§ä»¥ä¸ããã»ã¹ã®çµäºãå¾
ãããããã¨ã«ãªãã¾ããï¼
æ¸ãè¾¼ã¿å
ã®ãã£ã¹ã¯ã®æ¸ãè¾¼ã¿ããªã·ã¼ããããã©ã¼ãã³ã¹ã®ããã«æé©åãããã«å¤æ´ããã¨ããï¼é
延æ¸ãè¾¼ã¿ãã¼ã¿ãæ®ã£ã¦ãã¦ã CloseHandle ã§å¾
ããããªããªãã¾ããï¼
ãããï¼Cached I/O ã®å®é¨ããã¦ããããåå ã«æ°ã¥ãã話ã§ï¼åä½ã§ãã®ç¾è±¡ã«åºä¼ã£ã¦ãããåå 究æã«æéãããã£ã¦ããããããã¾ããï¼ã ã£ã¦æ®éï¼ä½ç¾ MB ãã®æ¸ãè¾¼ã¿ããã£ãã·ã¥ããã¦ãããªãã¦æãã¾ãããã®ããï¼
ã¾ã¨ã
- æ¨æºã® Windows XP SP2 ç°å¢ã§ã¯ï¼å¤§éã«ã¡ã¢ãªãæè¼ãã¦ãï¼CcDirtyPageThreshold ã¯æ大㧠22 MB ç¨åº¦ã«åºå®ããã¦ããããã§ãï¼ãã®ç¨åº¦ãªãï¼é
延æ¸ãè¾¼ã¿ã®å½±é¿ã¯ããã»ã©å¤§ããããã¾ããï¼
- ããã©ã«ãè¨å®ã® Windows XP SP2 ãï¼é 延æ¸ãè¾¼ã¿ã«ãã£ã¦ã³ãã¼æéãçãè¦ãã¦ããã¨ãã説ã¯ã¡ãã£ã¨æªããã§ãï¼22 MB ç¨åº¦ã®é 延æ¸ãè¾¼ã¿ã§ç¨¼ããæéã¨è¨ã£ã¦ãï¼ãããã 1 ç§ã§ãããï¼
- Windows Vista RTM çã§ã¯ï¼256 KB 以ä¸ã®ãµã¤ãºã®ãã¡ã¤ã«ã³ãã¼ã« Cached I/O ã使ãã¾ããï¼ãã®å ´åã¯ï¼ãã¡ã¤ã«ã³ãã¼ã¨ CcDirtyPageThreshold ã¯ç¡é¢ä¿ã§ãï¼ã³ãã¼å®äºæã«ã¯åºæ¬çã«æ¸ãè¾¼ã¿ãçµãã£ã¦ãã¾ãï¼
- Windows Vista SP1 ã§ã¯ï¼å
¨ã¦ã®ãµã¤ãºã®ãã¡ã¤ã«ã³ãã¼ã Cached I/O ã«æ»ãã¾ããï¼ãã¡ã¤ã«ã³ãã¼æã®é
延æ¸ãè¾¼ã¿ã®å½±é¿ã¯ï¼åã³ï¼å
¨ã¦ã®ãã¡ã¤ã«ãµã¤ãºã§ãèµ·ããããã«ãªãã¾ãï¼ããã CcDirtyPageThreshold ã®ããã©ã«ãå¤ãå¢ãã¦ããã®ã§ï¼å½±é¿ãåããã¦ã¼ã¶ã®æ°ã»è¦æ¨¡ã¨ãã«æ¡å¤§ãã¦ããã§ãããï¼
- ãã¼ã PC ã®ããã«ä½é㪠HDD ãæè¼ãã¦ãã¦ï¼ãã¤å¤§å®¹éã®ã¡ã¢ãªãå©ç¨ã§ããå ´åï¼å®éã®æ¸ãè¾¼ã¿å®äºã® 10 ç§ä»¥ä¸åã«ãã¡ã¤ã«ã³ãã¼ãã¤ã¢ãã°ã¯çµäºãã¦ããããããã¾ããï¼
- ããã©ã¼ãã³ã¹ã«ã¦ã³ã¿ãã«ã¼ãã«ãããã¬ã§é 延æ¸ãè¾¼ã¿ã®æ§åãç¥ããã¨ãã§ãã¾ãï¼æ°ã«ãªã人ã¯ãã§ãã¯ãã¦ã¿ã¾ãããï¼
- Windows Vista ã«ãªã£ã¦ (XP ã®ããã©ã«ãã«æ¯ã¹ãã°) CcDirtyPageThreshold ã¯ä¸è¬ã«å¤§ãããªã£ãããã§ãï¼ä»å¾ã¯ï¼ãã¹ã¯ãããã¢ããªã±ã¼ã·ã§ã³ã«ã¨ã£ã¦ãï¼é
延æ¸ãè¾¼ã¿ã®å½±é¿ã¯ç¡è¦ã§ããªããã®ã«ãªãã§ãããï¼
- ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ã¨ç§°ã㦠LargeSystemCache ã 1 ã«ãã¦ãã XP ã¦ã¼ã¶ã®ç°å¢ã§ã¯ï¼æ¢ã«æ°ç¾ MB è¦æ¨¡ã® CcDirtyPageThreshold ã使ããã¦ããå¯è½æ§ãå¼·ãã§ãï¼
- ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ã¨ç§°ã㦠LargeSystemCache ã 1 ã«ãã¦ãã Vista ã¦ã¼ã¶ã¯ï¼åã«æ°ä¼ããªã ãã¨ããå¯è½æ§ãããã¾ãï¼
- ãã¡ã¤ã«æ¸ãåºããµã¤ãºã CcDirtyPageThreshold ã¨åç¨åº¦ã®å ´åï¼è¦ãç®ã®æè¦æéãæ¯è¼ãããã³ããã¼ã¯ã¯ CPU é度ã¨å¼·ãç¸é¢ãæã¤ã¨èãããã¾ãï¼CPU ãããéãï¼CcDirtyPageThreshold ããã大ããç°å¢ã®æ¹ãï¼ä¸è¬ã«ãæè¦æéãã§ã¯æå©ã§ãï¼å ´åã«ãã£ã¦ã¯ï¼HDD æ§è½ã¨ã¯ã»ã¨ãã©ç¸é¢ãè¦ãããªããã¨ãããã§ãããï¼
- CcDirtyPageThreshold ãæ°ç¾ MB ã«å±ããããªç°å¢ã§ã¯ï¼ FlushFileBuffers ãè¡ã£ããï¼ãã¯ã¤ãã¯åé¤ã®ããã«æé©åããããé¸æãããã©ã¤ãã§ãã¡ã¤ã«ãã¯ãã¼ãºããã¨ãã«ï¼æ°åç§åä½ã®ãããã¯ãçºçããããããã¾ããï¼GUI ã¹ã¬ãããæå³ããé·æéæ¢ãã¦ãã¾ãï¼ã¦ã¼ã¶ã«ããã³ã°ãããã¨æãããªããããªæ³¨æãå¿ è¦ã§ãããï¼
- é
延æ¸ãè¾¼ã¿ã«ããã¬ã¹ãã³ã¹åä¸ãçã£ã¦ããå ´åï¼WriteFile ã«æ¸¡ããããã¡ãµã¤ãºã大ããããããã¨éå¹æã®å¯è½æ§ãããã¾ãï¼
- 64 KB ã¯æãã大ä¸å¤«ã§ï¼ãããããã 256 KB ã§ã OK ããããã¾ããï¼
- Windows ã¯ååçã«ãã¡ã¤ã«ã³ãã¼ã®æ¸ãè¾¼ã¿ã§ Cached I/O ã使ç¨ãã¾ãï¼ãã¡ã¤ã«ã³ãã¼ãã¤ã¢ãã°çµäºæã«ã¯ï¼æ大㧠CcDirtyPageThreshold ç¨åº¦ã®ãã¼ã¿ãæªæ¸ãè¾¼ã¿ã®å¯è½æ§ãããã¾ãï¼ä¾å¤ã Windows Vista RTM çã§ï¼ãã¡ã¤ã«ãµã¤ãºã 256 KB 以ä¸ã®å ´å㯠Non-Cached I/O ã使ç¨ãã¾ãï¼
- å¹³åé度ã°ã£ããè¦ãããããã³ããã¼ã¯è¨äº / Vista SP1 ã¬ãã¼ãè¨äºã«ã注æãï¼
- Vista RTM çã¨ãã®ä»ã® Windows ã®æè¦æéã並ã¹ã¦ç¤ºããå ´åï¼UI çã«ã¯åãå¤ãæ¯ã¹ã¦ããããã«è¦ãã¾ããï¼å®éã®åä½çã«ã¯æå³ãç°ãªãã°ã©ããååã«ä¸¦ã¹ã¦ããå¯è½æ§ãããã¾ãï¼
- .NET Framework ã® FileStream ã¯ã©ã¹ãããã©ã«ãã§ã¯ Cached I/O ã使ãã¾ãï¼
- ã¨ãªãã°ï¼64 KB åä½ã®æ¸ãè¾¼ã¿ã¨ï¼1 MB ã®åä½ã®æ¸ãè¾¼ã¿ã§ããã©ã¼ãã³ã¹ç¹æ§ãå ¨ç¶éãããããã¾ãããï¼ãã®æåã API ãããä¸ã®å±¤ã ãã§èª¬æãããã¨ããã¨æèè¿·è·¯ã«åããããã¨ã§ãããï¼
ãã¾ã
å³è§£ãCached I/O 使ç¨æã®ãã¡ã¤ã«æ¸ãè¾¼ã¿æéæ¨å®æ¹æ³ã
æ´æ°å±¥æ´
- 2008å¹´3æ6æ¥
- Windows XP SP2 㨠Windows Vista RTM çã§ï¼ãã¡ã¤ã«ã³ãã¼ä½æé度ãéããã¨ã®èª¬æãã¡ãã£ã¨è¨æ£ï¼Vista RTM çã§ã¯ãã¡ã¤ã«ã³ãã¼ã Non-Cached I/O ã ã£ãã®ã§ããï¼
- ã¡ãªããç®ç«ãããã®ã空æ°ãããªãæ°ããã¦ããã®ã§ãæ°ä»ãããç¨åº¦ã«ããããªã示ããã«æé¢å¤æ´ï¼
- 2008å¹´3æ7æ¥
- Windows Vista RTM çã§ãï¼256 KB 以ä¸ã®ãã¡ã¤ã«ã³ãã¼ã§ Cached I/O ã使ã£ã¦ããã®ãå¿ãã¦ããã®ã§ä¿®æ£ï¼è©³ç´°ãªã¢ã«ã´ãªãºã ã«ã¤ãã¦ã¯ç¬¬äºååç §ã®ãã¨ï¼
- 2008å¹´3æ10æ¥
- éå»ã®é¢é£è¨äºã追å ï¼
- 2009å¹´3æ16æ¥
- "ãã¡ã¢ãªä½¿ç¨éãã§ãã·ã¹ãã ãã£ãã·ã¥ã"ã¨æ¸ãã¹ãã¨ããã§"ãããã»ããµã®ã¹ã±ã¸ã¥ã¼ã«ã¨ã¡ã¢ãªä½¿ç¨éãã§ãããã¯ã°ã©ã¦ã³ããµã¼ãã¹åªå ã"ã¨æ¸ãã¦ããã®ãä¿®æ£ï¼
*1:1 å¹´åã®è¡æ¹ä¸æäºæ ã¯è¨æ¶ã«æ°ããã¨ããã§ãï¼ãã®è«æï¼1997 å¹´ã«ãåããããªå®é¨ãè¡ã£ã¦ãã¦ï¼ãã㨠2004 å¹´ã®æ¯è¼ãè¡ã£ã¦ãã¾ãï¼æãã次ãããã¨æå¾ ãã¦ãã¾ããï¼ããã«æ°ã®ååãè¼ããªãã§ããããã¨ã¯æ¬å½ã«åããã§ããã ï¼
*2:ãã¤ã³ãµã¤ã Windows 第4ç 11.7.3 æ¸ãè¾¼ã¿ã®æå¶ãã¾ãã¯ã[http://www.i.u-tokyo.ac.jp/edu/training/ss/lecture/new-documents/Lectures/15-CacheManager/CacheManager.pdf#Page=33:title=Cache Manager ã«é¢ããè¬ç¾©è³æã® 33 ãã¼ã¸ç®]ã
*3:ãã¡ããï¼Non-Cached I/Oï¼ã¤ã¾ã CreateFile 㧠FILE_FLAG_NO_BUFFERING ãä»ããå ´åã¯ï¼ãã£ãã·ã¥ããã¼ã¸ã£ã¯ä»å¨ãã¾ããããï¼ãã®å½±é¿ã¯åãã¾ãã
*4:Windows Vista ã§ã«ã¼ãã«ãããã°ãè¡ãã«ã¯ï¼OS èµ·åæã«ãªãã·ã§ã³ãå¿ è¦ã§ãï¼ã注æä¸ããï¼id:NyaRuRu:20071016:p1
*5:Vista ã§ã¯ãã³ã³ãã¥ã¼ã¿ã®ããããã£ãã«ä¸è¨è¨å®é ç®ã¯ç¡ããªã£ã¦ãã¾ããï¼ã[http://blogs.technet.com/askperf/archive/2008/02/01/ws2008-upgrade-paths-resource-limits-registry-values.aspx:title=WS2008: Upgrade Paths, Resource Limits & Registry Values - Ask the Performance Team]ãã«ããã°ï¼Windows Server 2008 ã§LargeSystemCache 㯠Not Used ã¨ã®ãã¨ã§ãï¼NT Kernel 6.0 以é㯠LargeSystemCache ã¯ä½¿ããã¦ããªãã®ããããã¾ãããï¼