ISUCON向けのツールを作った話 / isutools

D68ec2463959a924ada156a278743228?s=47 yudppp
November 06, 2019

ISUCON向けのツールを作った話 / isutools

ISUCON向けのツールを作った話
ISUCON9大反省会LT
https://github.com/yudppp/isutools

D68ec2463959a924ada156a278743228?s=128

yudppp

November 06, 2019
Tweet

Transcript

  1. ISUCON޲͚ͷπʔϧΛ࡞ͬͨ࿩ ISUCON9େ൓লձ

  2. pprofͷ݁ՌΛ؆୯ʹՄࢹԽ • pprofͷίϚϯυ๨Ε͕ͪ • Port։͚ͨΓFileΛscpͨ͠Γେม • ϕϯνϚʔΫճͨ͠͝ͱʹऔΓ͍ͨ

  3. DataDogͷSQLͷAPMΛऔΓ͍ͨ • DatadogͷAPM͸࠷ߴɻ͓͔͔ͨͩۚ͠Δɻ • SlowLog͚ͩͩͱΈΕͳ͍܏޲ΛΈ͍ͨɻ

  4. alpͷ݁ՌΛ؆୯ʹग़͍ͨ͠ • ϕϯνϚʔΫճͨ͠͝ͱʹऔΓ͍ͨ

  5. N+1 QueryΛ؆୯ʹൃݟ͍ͨ͠ • ໨ࢹͰN+1 QueryΛݟ͚ͭͯ௚ͨ͠Γ͢Δ͕ ࿙Ε͕͋ͬͨΓ͢ΔͷͰ؆୯ʹൃݟ͍ͨ͠

  6. ΍Γ͍ͨ͜ͱ·ͱΊ • pprofͷ݁ՌΛ؆୯ʹՄࢹԽ͍ͨ͠ • alpΈ͍ͨͳ݁ՌΛ؆୯ʹग़ྗ͍ͨ͠ • DataDogͷSQLͷAPMͷ݁ՌΈ͍ͨͳͷग़ྗ ͍ͨ͠ • N+1QueryΛ؆୯ʹൃݟ͍ͨ͠

  7. ͜ΕΒΛղܾ͢Δ࡞Γ·ͨ͠ɻ

  8. ͦͷ໊΋

  9. github.com/yudppp/isutools Iikanji ni speed up suru tools

  10. github.com/yudppp/isutools/profile • Initialize͢Δؔ਺ͷதʹ1ߦ௥Ճ͢Δ • Initializeͷؔ਺Λݺͼग़͔ͯ͠Βࢦఆͨ͠ඵ਺ ͷpprofͷ݁ՌΛSlackʹૹ৴͢Δ

  11. github.com/yudppp/isutools/profile • ϕϯνϚʔΫͷ࣮ߦ͝ͱʹຖճܭଌ݁ՌΛ Slackʹ౤͛ͯ͘ΕΔ • ϩάͱͯ͠࢒͞ΕΔͷͰ࣌ܥྻͰऴ͑ͯศར

  12. None
  13. github.com/yudppp/isutools/tracereporter • DataDogͷAPMͷlibrary(dd-trace-go)Λ࢖ͬ ͯ৭ʑͳ಺༰ΛSlackʹϨϙʔτ͢Δ • LibraryʹରԠ͍ͯ͠ΔϑϨʔϜϫʔΫશͯʹ ରԠ͞Ε͍ͯΔ

  14. sqlxͷྫ

  15. None
  16. gojiͷྫ

  17. None
  18. github.com/yudppp/isutools/tracereporter • ্هͷΈ͍ͨͳ΍ͭΛ্ख͘࢖͍߹ΘͤΔͱ

  19. None
  20. github.com/yudppp/isutools/utils/throttle • ࢦఆͨ͠ඵ਺ؒʹ࠷ॳͷ1ճ໨͔࣮͠ߦ͞Εͳ ͍΍ͭ(sync.Onceͱಉ͡ײ͡Ͱ࢖͑Δ)

  21. ·ͱΊ • དྷ೥ͦ͜͸݁Ռग़͍ͨ͠ɻ