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

20万RPMを捌くRailsアプリケーションの作り方

kikunantoka
December 08, 2018

 20万RPMを捌くRailsアプリケーションの作り方

kikunantoka

December 08, 2018
Tweet

More Decks by kikunantoka

Other Decks in Technology

Transcript

  1. LINE΋औΓѻ͍ͬͯ·͢ HJGUFFΠϯελϯτ΢ΟϯGPS-*/&ͷڧΈᶃ ©2018 gi)ee Inc. all rights reserved J நબ͔Βܠ඼ͷఏڙ·ͰҰؾ௨؏Ͱ͝ఏڙ

    நબγεςϜ ʢΠϯελϯτ΢Οϯʣ σδλϧΪϑτͷఏڙ ʢछྨҎ্ͷܠ඼ʣ ϦΞϧλΠϜʹநબɺ ͦͷ৔Ͱܠ඼Λ෇༩
  2. ෛՙݕূΛͯ͠ϘτϧωοΫΛऔΓআ͘ • DB ͷ Pool ਺΍ Puma ͷ Thread ਺ɺWorker

    ਺͸ద੾͔ • DB ͷ Pool ਺ -> Puma ͷεϨου਺ • Puma ͷ Worker ਺ -> CPUͷίΞ਺ • Puma ͷ Thread ਺ -> CPU࢖༻཰ͱ૬ஊ
  3. ࠷৽ͷΠϯελϯελΠϓΛ࢖͏ ໊લ W$16 3". $16ΫϨδοτ࣌ؒ ྉۚ࣌ؒ UTNBMM   

    64% UTNBMM    64% • ίεύ͕ྑ͍ • Puma ͷ Worker ਺Λ 2 ʹͰ͖Δ -> 2ഒͷεϨου਺
  4. WebαʔόΛཱͯ·͘Ε͹͍͍͍ͬͯ͏࿩Ͱ͸ͳ͍ • db.r4.16xlargeͷ৔߹ • 32 Threads x 2 Workers •

    1୆͋ͨΓ 64 Threads • 6000 / 64 = 93.75 • 92୆͙Β͍͕ݶքʂ