Upgrade to Pro — share decks privately, control downloads, hide ads and more …

社内ISUCONを開催した話

9318744519d282ae40e352e6a1b79b2a?s=47 takashabe
February 08, 2016

 社内ISUCONを開催した話

社内ISUCONリポジトリ
https://github.com/takashabe/isucon_internal

9318744519d282ae40e352e6a1b79b2a?s=128

takashabe

February 08, 2016
Tweet

Transcript

  1. ࣾ಺ISUCONΛ։࠵ͨ͠࿩ ࣾ಺ISUCONΛऴ͑ͯ ʙαʔόνϡʔχϯάษڧձʙ 2016/02/08 Takashi Abe

  2. ͩΕʁ • @takashabe • ΤόϯδΣϦετ() • ࣾ಺ISUCON։࠵͠·ͨ͠

  3. Agenda • ࣾ಺ISUCON֓࿦ • ϕϯνϚʔΫجૅ • ϓϩϑΝΠϦϯάجૅ

  4. ࣾ಺ISUCON֓࿦

  5. ࣾ಺ISUCONग़ͨਓʁ

  6. ੝Γ্͕ͬͨѹ౗తײँ

  7. ISUCON is Կ

  8. WebαʔϏεΛૣͯ͘͠ɺϕϯν ϚʔΫͰߴείΞΛग़͢ήʔϜ

  9. Πϯϑϥߏ੒

  10. None
  11. ֤αʔόͷ໾ׂ • webapp • 1ਓ1୆ɺڝٕऀʹ౉͞ΕΔαʔό • νϡʔχϯάର৅ͷwebαʔϏε͕Քಇ • portal •

    ϕϯνϚʔΫͷ࣮ߦɺείΞͷ֬ೝ • bench • webappαʔόʹରͯ͠ϦΫΤετΛ౤͛ͯܭଌ
  12. νϡʔχϯάϙΠϯτ • ϘτϧωοΫ͸DB • ༗ޮͳख๏ • ΫΤϦࣗମͷॻ͖׵͑ • ΫΤϦͷ౤͛ํ •

    ಛʹ᠘͸༻ҙͯ͠ͳ͍ • ۀ຿্Α͋͘ΔΑ͏ͳରԠΛߦ͑͹είΞ͕ग़Δ
  13. ϕϯνϚʔΫجૅ

  14. ϕϯνϚʔΧ͕΍͍ͬͯΔ͜ͱ 1. portal͕ϕϯνϚʔΧ࣮ߦΩϡʔΛੜ੒͢Δ 2. bench͕portalͷΩϡʔΛϙʔϦϯά͢Δ 3. ಛఆͷγφϦΦʹԊͬͯࢦఆͷwebappʹϦΫΤετ Λͻͨ͢Β౤͛Δ 4. Ϩεϙϯε݁ՌΛportalʹొ࿥͢Δ

  15. Ωϡʔͷੜ੒ • MySQLͰૉ๿ʹ؅ཧ

  16. ΩϡʔͷϙʔϦϯά • bench಺ͰϕϯνϚʔΧͱ͸ผͷϙʔϦϯάεΫϦϓτ ͕Քಇ͍ͯ͠Δ • portalʹ޲͚ͯ”waiting”ͷΩϡʔΛ୳͍ͯ͠Δ͚ͩ

  17. ಛఆͷγφϦΦʹԊͬͯϦΫΤετΛ౤͛Δ • ͍ΘΏΔϢχοτςετతͳHTTPϦΫΤετΛੜ੒͠ ͯwebappʹ౤͍͛ͯΔ • IO଴ͪΛߟྀͯ͠ͳΔ΂͘ฒྻͰ౤͍͛ͨ

  18. ฒྻ࣮ߦ def orders(): List[List[Scenario]] = { List( List(new Init), List(new

    Bootstrap), List(new Load, new Load, new Load, new Load, new Load, new LoadChecker) ) }
  19. γφϦΦ getStatus(s1, "/") match { case 200 => // Nothing

    case i: Int => { getAndCheck(s1, "/login", "LOGIN PAGE BECAUSE NOT LOGGED IN", (check) => check.isStatus(200)) postAndCheck(s1, "/login", getLoginForm(s1), "LOGIN POST WHEN LOGGED OUT", check => check.isRedirect("/")) getAndCheck(s1, "/", "SHOW INDEX AFTER LOGIN", check => check.isStatus(200)) } }
  20. ϓϩϑΝΠϦϯάجૅ

  21. “ਪଌ͢ΔͳܭଌͤΑ”

  22. ͓͢͢ΊϓϩϑΝΠϦϯάπʔϧ • MySQL • pt-query-digest • https://www.percona.com/doc/percona-toolkit/2.2/ pt-query-digest.html • Nginx/Apache/Varnish

    • kataribe • https://github.com/matsuu/kataribe • ֤ݴޠʹಛԽͨ͠΍ͭ • ֤ࣗΑ͠ͳʹ
  23. Demo

  24. ISUCON, ղ͘ͷ΋͍͍͚Ͳग़୊΋ ָ͍͠

  25. ϕϯνϚʔΧͷ஌ݟ

  26. ࣾ಺ISUCONָ͔ͬͨ͠Ͱ͢Ͷ ͓ർΕ͞·Ͱͨ͠