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

SmartHRのパフォーマンス改善が 総力戦だった話

DaisukeShinoku
September 11, 2023

SmartHRのパフォーマンス改善が 総力戦だった話

2023.09.08 Fri. Meetup for Ruby Engineers@メドピア株式会社様オフィス
https://medpeer.connpass.com/event/292464/

DaisukeShinoku

September 11, 2023
Tweet

More Decks by DaisukeShinoku

Other Decks in Programming

Transcript

  1. 4NBSU)3ͷύϑΥʔϚϯεվળ͕
    ૯ྗઓͩͬͨ࿩
    'SJ.FFUVQGPS3VCZ&OHJOFFST!ϝυϐΞגࣜձ༷ࣾΦϑΟε
    ৽Ԟେհ
    4NBSU)3αʔόʔαΠυΤϯδχΞ

    View full-size slide

  2. ৽Ԟେհʢ͠Μ͓͍͚ͩ͘͢ʣ
    ߤւ࢜ ೥

    8FCडୗ։ൃΤϯδχΞ ೥ϲ݄

    4NBSU)3ΤϯδχΞ ϲ݄

    ࣗΒધΛૢॎͯ͠ύφϚӡՏΛ౉ͬͨ
    །Ұͷ೔ຊਓ8FCΤϯδχΞʢଟ෼ʣ
    ࣗݾ঺հ
    ଠฏ༸
    େ੢༸

    View full-size slide

  3. 4NBSU)3ʹೖࣾͨͯ͠ͷࢲ͕ɺ෼ੳϨϙʔτ։ൃ
    νʔϜͰύϑΥʔϚϯεվળʹऔΓ૊ΜͰײͨ͡
    ʮ4NBSU)3։ൃ૊৫ͷ૯ྗઓͿΓʯʹ͍ͭͯ
    ˣ
    ஌ͬͯ΄͍͠ͱ͜Ζ
    ɾνʔϜϫʔΫతͳ૯ྗઓͿΓ
    ɾπʔϧతͳ૯ྗઓͿΓ
    ຊ೔ͷςʔϚ
    ։ൃऀମݧ͕ྑ͍ʂ

    View full-size slide

  4. ෼ੳϨϙʔτͱ͸
    ਓࣄσʔλΛूܭɾՄࢹԽ͢Δ#*πʔϧ
    ɾ4NBSU)3ຊମ͔Β)551௨৴Ͱσʔλऔಘ
    ɾՄࢹԽ࣮ݱͷͨΊͷෳࡶͳΫΤϦ
    ɾ௕͍ྺ࢙Ͱൃੜͨ͠ෛ࠴ʢ೥݄dʣ
    ˣ
    ύϑΥʔϚϯε໘ͰϢʔβʔͷӡ༻ʹࢧোΛ
    དྷ͍ͯ͠ΔڪΕ
    4NBSU)3ຊମ
    ෼ੳϨϙʔτ
    )551

    View full-size slide

  5. ύϑΥʔϚϯεվળͷ͖͔͚ͬ
    ɾେاۀͱ঎ஊ૿Ճ
    ɾن໛ͷେ͖͍Ϣʔβʔاۀͷ૿Ճ
    ϏδωεతཁҼ
    #JH2VFSZ3FEBTIΛར༻
    ͨ͠೔ʑͷ෼ੳ
    #J[ϝϯόʔ˱%FWϝϯόʔ
    Ͱͷίϛϡχέʔγϣϯ

    View full-size slide

  6. 4NBSU)3ʹ͓͚Δ#JH2VFSZͱ3FEBTI
    ֤ϓϩμΫτͷσʔλΛݸਓ৘ใΛϚεΫͯ͠#JH2VFSZ
    ΁*NQPSU͢Δ࢓૊ΈΛΫϥ΢υج൫νʔϜओಋͰߏங
    ˣ
    3FEBTIͱ͍͏πʔϧͰ෼ੳۀ຿ʹར༻

    View full-size slide

  7. ύϑΥʔϚϯεվળͷ͸͡·Γ
    ɾσʔλಉظͷ௕࣌ؒԽ
    ɾԿेඵ୯ҐͷϨεϙϯεͷൃੜ
    ٕज़తཁҼ
    /FX3FMJDμογϡϘʔυʹ
    ͯϞχλϦϯά

    View full-size slide

  8. /FX3FMJDͷ׆༻
    ҟৗࣄଶʢஶ͍͠Ϩεϙϯε଎౓ѱԽͳͲʣ
    Λݕ஌͢ΔͨΊ/FX3FMJDμογϡϘʔυΛར༻

    View full-size slide

  9. ૯ྗઓͰऔΓ૊ΉύϑΥʔϚϯεվળ
    ຊମ෼ੳϨϙʔτؒͷσʔλಉظॲཧΛվળͨ͠ࣄ
    ྫΛղઆ
    ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  10. ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  11. ݱঢ়෼ੳʢଌఆ༻ςετςφϯτͷ४උʣ
    4NBSU)3Ͱ͸ଟ༷ͳσʔλΛѻ͍ͬͯΔͨΊɺςετ
    ༻ͷςφϯτͷ࡞੒ʹ΋࿑ྗ͕͔͔Δ
    ˣ
    ඼࣭อূͷϓϩɺ2"άϧʔϓ͕؅ཧ͢Δσʔλ࡞੒ε
    ΫϦϓτͷग़൪

    View full-size slide

  12. ݱঢ়෼ੳʢϦΞϧςφϯτͷ෼ੳʣ
    ࣮ࡍͷϢʔβʔͷ࢖༻ײ΋೺Ѳ͍ͨ͠
    ˠ/FX3FMJDμογϡϘʔυ($1ͷ-PH"OBMZUJDT
    ͰϩάΛৄࡉ෼ੳ

    View full-size slide

  13. ݱঢ়෼ੳʢݱঢ়ͷՄࢹԽʣ
    σʔλಉظʹ͔͔ͬͨ࣌ؒΛاۀن໛ɾॴཁ࣌ؒͰ෼ྨ
    ͯ͠ΤϯδχΞҎ֎ʹ΋Ұ໨ͰΘ͔ΔΑ͏ՄࢹԽ
    ਓҎԼ dਓ dਓ ਓ௒

    View full-size slide

  14. ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  15. ΰʔϧઃఆ
    ʮݱঢ়͔ΒͲͷΑ͏ͳঢ়ଶʹͳΕ͹վળͱݴ͑Δʁʯ
    ։ൃϝϯόʔͷ࿮Λ௒͑ͯؔ܎ऀΛר͖ࠐΜͰٞ࿦
    ˠΤϯδχΞͱؔ܎ऀؒͷೝࣝͷζϨΛຒΊΔ
    ˠϢʔβʔͱ͍ۙ৔ॴʹ͍Δ#J[ϝϯόʔͷײ֮Λฉ͘

    View full-size slide

  16. ΰʔϧઃఆ
    Ϣʔβʔͱ઀͢Δػձͷଟ͍ʮΧελϚʔαΫηεʯ΍
    ʮνϟοταϙʔτʯϝϯόʔͷҙݟʹΑͬͯɺΑΓߴ
    ͍ղ૾౓Ͱͷΰʔϧઃఆ͕Մೳʹʂ
    ։ൃνʔϜ
    εςʔΫϗϧμʔ

    View full-size slide

  17. ΰʔϧઃఆ
    zdਓن໛ͷςφϯτzͰ෼Ҏ಺׬ׂྃ߹௒
    ˠϏδωε্ͷ஫ྗλʔήοτʹ࢖ͬͯ΋Β͑Δਫ४
    ෼Ҏ಺
    ෼௒
    ෼Ҏ಺
    ෼௒
    ໿

    ݱঢ় ໨ࢦ͢ΰʔϧ

    View full-size slide

  18. ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  19. ԾઆݕূʢԾ࣮૷ʣ
    -PH"OBMZUJDTʹΑΔϩάͷৄࡉ෼ੳɿ
    ຊମ෼ੳϨϙʔτؒͷࠩ෼ΛൺֱͤͣຖಉظͰ
    <࡟আ>ˠ<৽نొ࿥>ΛҰׅͰ͍ͯ͠ΔॲཧΛൃݟ
    ࣮૷ํ਑ɿ
    ಉظॲཧ࣮ߦ࣌ͷຊମ෼ੳϨϙʔτؒͷࠩ෼ʹԠͯ͡
    <৽نొ࿥>ɺ<ߋ৽>ɺ<࡟আ>ɺ<Կ΋͠ͳ͍ʢߋ৽ͳ͠ʣ>
    Λࡉ੍͔͘ޚ͢Δ͜ͱͰߴ଎Խ͢ΔͱԾઆ
    Ծ࣮૷ஈ֊Ͱ଎౓ܭଌΛ࣮ࢪ

    View full-size slide

  20. Ծઆݕূʢ଎౓ܭଌʣ
    ಈ࡞ݕূ༻؀ڥΛຊ൪؀ڥͱಉ౳εϖοΫʹҰ࣌తʹ૿
    ڧͯ͠଎౓ܭଌͨ݁͠Ռ
    ෼ඵˠ෼ඵʢഒʣ
    ͱ͍͏݁ՌͱͳΓ֬౓ͷߴ͍վળҊͰ͋Δ͜ͱΛ֬৴

    View full-size slide

  21. Ծઆݕূʢ଎౓ܭଌʣ
    ಈ࡞ݕূ༻؀ڥΛຊ൪؀ڥͱಉ౳εϖοΫʹҰ࣌తʹ૿
    ڧͯ͠଎౓ܭଌͨ݁͠Ռ
    ෼ඵˠ෼ඵʢഒʣ
    ͱ͍͏݁ՌͱͳΓ֬౓ͷߴ͍վળҊͰ͋Δ͜ͱΛ֬৴
    4NBSU)3Πϯϑϥࣄ৘
    Ϋϥ΢υج൫νʔϜओಋͰ5FSSBGPSNΛಋೖࡁ
    ։ൃνʔϜ͕ύϥϝʔλʔΛઃఆ͢Δ͚ͩͰ؀ڥߏங͕Մೳ

    View full-size slide

  22. ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  23. ࣮૷ɾϦϦʔε
    Ծ࣮૷ঢ়ଶ͔Β҆શੑΛ୲อ͢ΔϑΣʔζͰطଘͷςετ
    ίʔυෆ଍౳ͷཁҼ͕͋ΓϦϦʔεΛҰ౓Ԇظ͕ͨ͠ɾɾ
    ˣ
    ϞϒϓϩɺίʔυϨϏϡʔΛ௨ͯ͠νʔϜશһ͕ࣗ৴Λ
    ࣋ͬͨঢ়ଶͰຬΛ࣋ͯ͠ຊ൪؀ڥ΁ϦϦʔεʂʂ
    ৺ʹ࢒ͬͨ1E.
    ͷίϝϯτ
    ΤϯδχΞͷഽײ֮͸ॏཁͳͷͰ
    ʮςετͳ͍ͷා͍ΑͶʯͬͯ
    ϦϦʔεʹ଴ͬͨΛ͔͚ͯ͘ΕΔͷ
    ͱͯ΋ॿ͔Δ

    View full-size slide

  24. ΰʔϧઃఆ
    ݱঢ়෼ੳ Ծઆݕূ ࣮૷ɾϦϦʔε ޮՌଌఆ

    View full-size slide

  25. ޮՌଌఆ
    ςετςφϯτͰͷ݁Ռ΍ɺಛఆςφϯτͰͷϩά͚ͩͰ
    ͳ͘ɺվળޮՌ΋3FEBTIΛ࢖͔ͬͯͬ͠ΓͱՄࢹԽ͢Δ
    վળલ վળޙ
    ୭͕ݟͯ΋վળ͕໌Β͔ʂ

    View full-size slide

  26. CONFIDENTIAL
    ໨ඪ͸ୡ੒Ͱ͖ͨͷ͔ʁʁ
    ϥΠϯ
    վળલ
    zdਓن໛ͷςφϯτzͰ෼Ҏ಺׬ׂྃ߹௒
    ෼Ҏ಺
    ෼௒

    View full-size slide

  27. CONFIDENTIAL
    ϥΠϯ
    վળલ վળޙ
    zdਓن໛ͷςφϯτzͰ෼Ҏ಺׬ׂྃ߹௒
    ෼Ҏ಺
    ෼௒
    ෼Ҏ಺
    ෼௒
    ໨ඪ͸ୡ੒Ͱ͖ͨͷ͔ʁʁ

    View full-size slide

  28. CONFIDENTIAL
    ୡ੒ʂʂ

    View full-size slide

  29. CONFIDENTIAL
    ύϑΥʔϚϯεվળର৅͸σʔ
    λಉظ͚ͩͰ͸ͳ͍ɾɾɾ

    View full-size slide

  30. CONFIDENTIAL
    ϑϩϯτͷϨϯμϦϯάॲཧ
    άϥϑදࣔͷͨΊͷ42-FUDʜ

    View full-size slide

  31. CONFIDENTIAL
    Զͨͪ෼ੳϨϙʔτ։ൃνʔϜ
    ͷઓ͍͸͜Ε͔Βͩʂ

    View full-size slide

  32. CONFIDENTIAL
    ͱ͍͏͜ͱͰຊ೔ͷ·ͱΊ

    View full-size slide

  33. CONFIDENTIAL
    ύϑΥʔϚϯεվળͷऔΓ૊Έํ
    ɾؔ܎ऀΛ޿͘ר͖ࠐΉνʔϜϓϨΠ
    ɾࣾ಺Ͱར༻Ͱ͖ΔπʔϧΛ࠷େݶ׆༻
    ˣ
    ɾνʔϜ͕ಉ͡ํ޲Λ޲͍͍ͯΔҰମײ
    ɾվળ͕Ϣʔβʔʹಧ͍͍ͯΔͱ͍͏ࣗ৴
    ։ൃऀମݧͷ޲্ʹ΋ܨ͕͍ͬͯΔ

    View full-size slide

  34. CONFIDENTIAL
    ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide