· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Linux 2.6 I/O Scheduler Configuration



1. I/O scheduler

  • Çϵåµð½ºÅ©¿¡ ÃÖÀûÈ­µÈ ºí·° µð¹ÙÀ̽º ½ºÄÉÁÙ¸µ ¾Ë°í¸®ÁòÀ» ÀǹÌÇÑ´Ù.
  • SATA controller ¶Ç´Â ÀϹÝÀûÀÎ HDD diskÀÇ controller¸¦ ÀÌ¿ëÇÏ´Â SSD Á¦Ç°ÀÇ °æ¿ì, NOOP¸¦ ¼±ÅÃÇϸé Ź¿ùÇÑ ¼º´É Çâ»óÀÌ ÀÖ´Ù.

2. ¹®Á¦ÀÇ °í¹Î

  • Writes-Starving-Reads
    • Writeµ¿ÀÛÀº ¹öÆÛ¿¡ ¹Ð¾î³Ö°í ¹öÆÛ¿¡¼­ Merge ¹× Sort¸¦ ÇÏ¿© ÀÏ·ÃÀÇ ¿¬¼ÓµÈ Writeµ¿ÀÛÀ¸·Î 󸮵ɼö ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ÀÌ °úÁ¤¿¡¼­ Readµ¿ÀÛÀÌ ³¢¾îµé°Ô µÇ¸é I/O¿äû¼ø¼­¿¡ ÀÔ°¢ÇÏ¿© 󸮵Ǹ鼭 ¿¬¼ÓÀûÀÎ Readµ¿ÀÛÀ» ÇÏÁö ¾Ê°Ô µÇ°í ÀÚÁÖ SeekÇϸ鼭 ¼º´ÉÀÌ ±Ø´ëÈ­ µÇ±â Èûµé°Ô µË´Ï´Ù. ÀÌ·¯ÇÑ I/O SchedulerÀÇ µ¿ÀÛ¿¡ ÀÇÇÑ Çö»óÀ» "Writes-starving-reads"¶ó°í ÇÕ´Ï´Ù.
  • Effects of High Read Latency
    • ³í¸®ÀûÀ¸·Î ¿¬¼ÓÀûÀÎ Ä¿´Ù¶õ Data¸¦ ReadÇÏ´Â Áß¿¡ ÀÛÀº Data¸¦ Àд µ¿ÀÛÀÌ ³¢¾îµé°Ô µÇ¸é ÀÛÀº Data¸¦ ReadÇϴ°Ϳ¡ ´ëÇÏ¿© ¾î¶²°Í¿¡ ¼º´ÉÀÇ ÃÊÁ¡À» ¸ÂÃç¾ß ÇÏ´ÂÁö¿¡ ´ëÇÑ °¥µîÀÇ ¹®Á¦°¡ »ý±é´Ï´Ù. ÀÌ°ÍÀ» "Effects of High Read Latency"¶ó°í ÇÕ´Ï´Ù.

3. I/O scheduler Á¾·ù

  • Linus Elevator
    • Ä¿³Î 2.6¿¡¼­´Â deadlineÀ¸·Î ÁøÈ­ÇÔ. 2.4 ±îÁö¸¸ »ç¿ëµÊ. deadlineÀ» ¼³¸íÇϱâ À§ÇØ ±â·Ï
    • Å¥¿¡¼­ ¿äûÀ» (block number ¼øÀ¸·Î) Insertion sort ÇÏ´Ù°¡ age°¡ ¿À·¡ µÈ ¿äûÀÌ ÀÖÀ¸¸é ±×°ÅºÎÅÍ Ã³¸®ÇÏ´Â ¹æ½ÄÀÌ´Ù.

  • Completely Fair Queuing (CFQ)
    • ±âº» I/O scheduler
    • CFQ ½ºÄÉÁÙ·¯´Â ±¤¹üÀ§ÇÑ ÀÀ¿ë ÇÁ·Î±×·¥°ú I/O ½Ã½ºÅÛ ¼³°è¿¡ ÃÖ»óÀÇ ¼º´ÉÀ» Á¦°øÇϱ⠶§¹®¿¡ ±âº» ½ºÄÉÁÙ·¯·Î ¼±ÅÃÀÌ µÇ¾ú´Ù. 16°³ÀÇ CPU¸¦ °¡Áö°í ÀÖ°í, Ultra SCSI¿Í Fiber channel·Î ±¸¼ºµÈ 2~64°³ÀÇ LUNÀ» °¡Áø ½Ã½ºÅÛ¿¡¼­ CFQ´Â Ź¿ùÇÑ ¼º´ÉÀ» ¹ßÈÖÇÑ °ÍÀ¸·Î ¾Ë·ÁÁ® ÀÖ´Ù. °Ô´Ù°¡ CFQ´Â ´Ù¸¥ I/O subsystemÀÇ ¼º´É°ú ÀÏÄ¡ÇÒ ¼ö ÀÖµµ·Ï /proc/sys/scsi subsystem¿¡ ÀÖ´Â nr_requests ÆĶó¹ÌÅ͸¦ Á¶Á¤ÇÏ¿© ½±°Ô ÃÖÀûÈ­ ÇÒ ¼ö ÀÖ´Ù.
    • CFQ(Complete Fair Queuing)´Â °¢ ÇÁ·Î¼¼½º ¸¶´Ù ÀÛ¾÷ Å¥¸¦ °¡Áö°í ÀÖ°í À̰͵éÀÌ round robin¹æ½ÄÀ¸·Î µ¹¸ç Á¤ÇØÁø time slice ³»¿¡¼­ ÀÛ¾÷À» ¼öÇàÇÏ°Ô µÈ´Ù. time slice¾È¿¡ ÀÛ¾÷À» ¸ðµÎ ³¡³»°Ô µÇ¾îµµ 10ms Á¤µµ¸¦ Ãß°¡·Î ±â´Ù¸®¸ç Ȥ½Ã³ª ÀÖÀ» I/O ÀÛ¾÷À» ´ë±âÇÏ´Ù°¡ ¾Èµé¾î¿À¸é ´Ù¸¥ ÇÁ·Î¼¼½ºÀÇ Å¥·Î À̵¿ÇÑ´Ù. °¢ Å¥¿¡¼­´Â synchronous ¿äûÀÌ asynchronousº¸´Ù ¿ì¼±¼øÀ§¸¦ °¡Áö°í ÁøÇàµÇ¾î writes-starving-reads ¹®Á¦¸¦ ÇØ°áÇÑ´Ù.

  • Deadline
    • Deadline ½ºÄÉÁÙ·¯´Â real-time °°Àº single I/O ó·³ ¿¬¼ÓµÈ read¸¦ ºü¸£°í È¿À²ÀûÀ¸·Î ó¸®Çϱâ À§ÇÏ¿© ´ë±â ½Ã°£À» °¡Áö´Â ¹æ½ÄÀÌ´Ù. Single I/O ȯ°æ¿¡¼­´Â ºü¸£Áö¸¸ multip HBA ¶Ç´Â ÆÄÀϽýºÅÛ°£ÀÇ Æ®·£Á§¼Ç¿¡´Â Ç×»ó ÃÖ»óÀÇ ¼±ÅÃÀÌ µÉ ¼ö´Â ¾ø´Ù.
    • Linux ElevatorÀÇ ÀÛ¾÷ Å¥¿Ü¿¡ º°µµÀÇ read/write Å¥¸¦ µÐ´Ù. ÀÛ¾÷ Å¥¿¡´Â ¿äûÀÌ block ¹øÈ£ ¼ø¼­·Î Á¤·ÄµÇ¾î ÀÖ°í, read/writeÅ¥´Â FIFO·Î (¿äû µé¾î¿Â ¼ø¼­´ë·Î) µé¾î°£´Ù. I/O Scheduler´Â ÀÛ¾÷ Å¥¿¡ Á¤·ÄµÈ ¿äûµéÀ» °¡Áö°í ÀÛ¾÷À» ÇÏ´Ù°¡ expiration time¿¡ ³ÑÀº ¿äûÀÌ ¹ß°ßµÇ¸é ±× ¿äûÀ» °¡Áö°í ÀÖ´Â read(ȤÀº write)Å¥¿¡°¡¼­ ÀÛ¾÷À» ÁøÇàÇÑ´Ù. ÀϹÝÀûÀ¸·Î read Å¥´Â expiration timeÀÌ 500ms·Î ª°í write Å¥´Â 5ÃÊÁ¤µµ·Î ÁØ´Ù.

  • Anticipatory
    • Ãßõ ´ë»ó
      • Á¦ÇÑµÈ I/O ¼³Á¤À» °¡Áö°í ÀÖ´Â °æ¿ì
      • 1 ¶Ç´Â 2°³ÀÇ LUN¸¸ °¡Áö°í ÀÕ´Â ÀÛÀº ½Ã½ºÅÛ
      • I/O ´ë±â½Ã°£ º¸´Ù ´ëÈ­Çü ÀÀ´ä½Ã°£¿¡ ¿ì¼±±ÇÀ» ÁÖ´Â °ÍÀÌ À¯¸®ÇÒ °æ¿ì (´ëºÎºÐÀÇ workstationµé..)
    • ¿¬¼ÓµÈ ºÎºÐÀÇ read ¿äûÀÇ °æ¿ì µð½ºÅ©ÀÇ Çì´õ´Â ÀÌ¹Ì ´Ù¸¥ À§Ä¡·Î À̵¿ÇØ ÀÖ´Â »óÅ¿¡¼­ ´Ù½Ã ÀÌÀüÀÇ À§Ä¡·Î À̵¿ÇÏ¿© ÀÛ¾÷À» ¼öÇàÇÏ°Ô µÇ´Â ³¶ºñ°¡ ÀÖ´Ù. ¶§¹®¿¡ ¿¬¼ÓÀûÀÎ read¸¦ À§ÇØ ÇѹøÀÇ read°¡ ¸¶ÃÄÁö¸é ÃÖ´ë 6ms ±îÁö ¾Æ¹«Àϵµ ¼öÇàÇÏÁö ¾Ê°í (ÇìµåÀÇ À§Ä¡¸¦ À̵¿ÇÏÁö ¾Ê°í) ´ë±âÇؼ­ ¿¬¼ÓÀûÀÎ readÀÛ¾÷½Ã ½Ã°£À» ¾Æ³¢´Â ¹æ½ÄÀÇ ½ºÄÉÁ층À» anticipatory I/O scheduler¶ó°í ÇÑ´Ù.

  • NOOP
    • ºí·° ¹øÈ£ ¼øÀ¸·Î Á¤·ÄÀº ÇÏÁö ¾Ê°í merging¸¸ ÇÏ´Â ½ºÄÉÁì·¯ ÀÌ´Ù. Hard Disk ¹æ½ÄÀÇ controller (sata/sas)¸¦ »ç¿ëÇÏ´Â SSDÀÇ °æ¿ì, ÀÌ ¹æ½ÄÀ» ¼±ÅÃÇϵµ·Ï ÇÑ´Ù.
    • º°µµ controller¸¦ °¡Áö°í ÀÖÀ» °æ¿ì, driver´Ü¿¡¼­ ÀÌ¹Ì ÃÖÀûÈ­ ¾Ë°í¸®ÁòÀ» °¡Áö°í Àֱ⠶§¹®¿¡ ½Å°æ¾µ ÇÊ¿ä ¾øÀ½. (¿¹.. Fusion IO)

4. ¼³Á¤

  • kernel 2.6 ºÎÅÍ´Â sys filesystem ¿¡¼­ ¼³Á¤À» ÇÑ´Ù.
  • Ä¿³Î ¹öÀü¿¡ µû¶ó °æ·Î°¡ º¯°æµÉ ¼ö ÀÖ´Ù.
    # cat /sys/block/{DEVICE-NAME}/queue/scheduler
    # cat /sys/block/sda/queue/scheduler
    


  • change scheduler
    # echo {SCHEDULER-NAME} > /sys/block/{DEVICE-NAME}/queue/scheduler
    # echo noop > /sys/block/hda/queue/scheduler
    



ID
Password
Join
Generosity and perfection are your everlasting goals.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2012-01-26 11:10:52
Processing time 0.0051 sec