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

ISUCON 11 参考実装 PHP 移植の苦労?話

ISUCON 11 参考実装 PHP 移植の苦労?話

2021/10/02, 03 開催「PHP Conference Japan 2021」(https://phpcon.php.gr.jp/2021/)の懇親会 LT 資料です。

Shohei Okada

October 04, 2021
Tweet

More Decks by Shohei Okada

Other Decks in Programming

Transcript

  1. *46$0/ࢀߟ࣮૷
    1)1Ҡ২ͷۤ࿑ʁ࿩
    1)1$POGFSFODF+BQBO࠙਌ձ
    !PLBTIPJ

    View full-size slide

  2. ΍Γ·ͨ͠
    ۓுͯ͠·ͱ΋ʹ࿩ͤͳ͔ͬͨ

    View full-size slide

  3. ͜ͷ৔ͰϦϕϯδʂ

    View full-size slide

  4. Ͱ͖Δ͚ͩαʔυύʔςΟ੡ϥΠϒϥϦ΁ͷґଘΛ࠷খʹ
    Ͱ΋ *46$0/Ͱ෗ഊ๷ࢭ૚Λ࡞Δͷ͸ 5PP.VDIͳͷͰ΍Βͳ͍
    ҙࣝͨ͜͠ͱ
    ༧બ໰୊ͷ DPNQPTFSKTPO ຊઓ໰୊ͷ DPNQPTFSKTPO

    View full-size slide

  5. ଞͷݴޠͱͷ৘ใྔͷࠩҟΛͰ͖Δ͚ͩݮΒ͢
    ʢओཁϩδοΫ͸ʣϑΝΠϧʹू໿
    w ͨͩ͠ʮSPVUFTQIQͱ͸🤔ʯͬͯͳͬͨ
    ͍͍ͪͪܕΛ෇͚Δ
    w ͜Ε͸ࣗ෼͕࣮૷͢Δ্Ͱ΋ॿ͚ʹͳΔ
    ҙࣝͨ͜͠ͱ

    View full-size slide

  6. w 1)1ͱͦΕҎ֎Ͱͦ΋ͦ΋ΞʔΩςΫνϟҧ͏͠
    w ΤϥʔϋϯυϦϯά·ΘΓʢΦϦδφϧ͸ (Pʣ
    w ϥΠϒϥϦͷΤϥʔͷग़͠ํ͕ (Pͱ͸ҟͳͬͯ΋
    ֎͔Βݟͨڍಈ͸Ұகͤ͞ͳ͍ͱ͍͚ͳ͍
    w ྫ֎Λ࢖͏ͱܭࢉྔͷίετ૿໰୊΋ʢҰԠʣ͋Δ
    w ࡉ͔ͳͱ͜ΖͰ͸ม਺໊ͳͲ
    ˠաڈͷ *46$0/ͷ 1)1࣮૷Λࢀߟʹͭͭ͠όϥϯεΛऔΔ
    ͍ͨ΁Μͩͬͨ͜ͱ ΦϦδφϧ࣮૷ͷ࠶ݱ WT1)1ͷྲّྀ

    View full-size slide

  7. ࢖͏ͷ͸͓ͳ͡Έ 1%0
    w 1%0'&5$)@#05)Ͱ഑ྻͷ··ѻ͏ ˠܕͷԸܙʹ༩Εͳ͍
    w 1%0'&5$)@$-"44ˠ஋͕จࣈྻʹͳͬͯ͠·͏
    ʢCPPMͱ͔ %BUFUJNF*NNVUBCMFʹม׵͔ͯ͠Β֨ೲ͍ͨ͠ʣ
    ˠ஋ΛύοΫ͢Δ DMBTTʹ GSPN%C3PX
    ͱ͍͏ TUBUJDϝιουΛੜ΍
    ͨ͠ʢ+40/͔Βͷม׵΋ಉ༷ͳײ͡ʹͨ͠ʣ
    ʜʜ͕ɺ͜Ε͕݁ߏ໘౗
    ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍

    View full-size slide

  8. (PͰ͸͜ΕͰࡁΉఆ͕ٛ
    ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍

    View full-size slide

  9. ͜͏͡Ό
    ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍

    View full-size slide

  10. ༧બ໰୊Ͱͷൺֱ
    w NBJOHPߦɺ͏ͪߏ଄ମఆ͕ٛ ߦ
    w SPVUFTQIQߦɺ͏ͪΫϥεఆ͕ٛ ߦ
    ˠΫϥεͷఆ͚ٛͩͰ ഒ͍ۙྔͷίʔσΟϯά͕ඞཁʹ
    ͦ͏͍͑͹͜Ε͸ 1)1💡
    ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍

    View full-size slide

  11. ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍
    "UUSJCVUFTͷྗ

    View full-size slide

  12. ͍ͨ΁Μͩͬͨ͜ͱ %#͔Βऔಘͨ͠σʔλͷѻ͍
    "UUSJCVUFTͷྗ
    ʮࣗ෼͕ *46$0/ࢀՃऀͩͬͨΒɺ͜ͷ࣮૷ग़͖ͯͨΒΩϨΔΘʯ
    ͱࢥͬͨͷͰ΍ΊΔ

    View full-size slide

  13. ϕϯνϚʔΧͱ͍͏ઈରਖ਼ٛͷΠϯςάϨʔγϣϯςετ͕ଘࡏ͢Δ
    w ʮݴޠΛशಘ͢Δڭࡐʯͱͯ͠ͷ *46$0/ࢀߟ࣮૷ͷՄೳੑ
    w ͨͩ͠ʢҠ২࡞ۀظؒ͸ʣϕϯνϚʔΧʹ΋όά͸͋Δ
    Α͔ͬͨ͜ͱ

    View full-size slide

  14. *46$0/ͷӡӦଆ͕ݟΒΕͨ
    w ӡӦࢹ఺ͷ׉౻΍ *46$0/΁ͷ૝͍ͳͲ
    w ͭΑ͍ͻͱͨͪͱҰॹʹ࢓ࣄ͕Ͱ͖ͨ
    w ීஈ 1)1ॻ͍ͯͳ͍͸ͣͷਓ͔ΒʮFYFD
    ͩͱγΣϧܦ༝Ͱͷ࣮
    ߦʹͳΔͷͰ (P࣮૷ͱൺ΂ͯύϑΥʔϚϯεʹѱӨڹͰ·͢Ͷʯ
    ͬͯݴͬͯ 13ඈΜͰ͘ΔʢϠό͍ʣ
    w IUUQTHJUIVCDPNJTVDPOJTVDPOGJOBMQVMM
    Α͔ͬͨ͜ͱ

    View full-size slide

  15. ࣗ෼ͷΤΰΛଘ෼ʹ৐͚ͬͯίʔυॻ͚ͨ
    w 1)1Ͱʮཁ݅ͷଘࡏ͢ΔΞϓϦέʔγϣϯʯ͕ॻ͚ͨ
    w ͜͜·Ͱʮ͖ͪΜͱʯ1)1Λ࢖ͬͨ͜ͱ͸࣮͸ແ͔͔ͬͨ΋஌Εͳ͍
    w 1%0ͷΦϓγϣϯ΍ΤϥʔϋϯυϦϯά
    w 04ίϚϯυΛ࣮ߦ͢Δͱ͖ͷؔ਺ͱΦϓγϣϯࢦఆ
    ʮίʔυͷ͢΂͕ͯࣗ෼ͷखதʹ͋Δʯײ֮
    ͜Μͳʹָ͘͠ίʔυΛॻ͍ͨͷ͸͍ͭͿΓͩͬͨͩΖ͏
    Α͔ͬͨ͜ͱ

    View full-size slide

  16. ॳظ࣮૷ͰͷείΞ͸ଞͷݴޠΑΓ΋௿Ί
    w ΞʔΩςΫνϟ͕ҧ͍ͬͯͨΓɺ1)1'1.౳ͷઃఆ͕΄΅σϑΥϧτ
    ͩͬͨΓɺ࢓ํͳ͍෦෼΋͋Δ͔΋͠Εͳ͍͕
    w 1)1ΛબΜ͚ͩͩͰʮएׯʯෆརͱ͍͏ͷ͸չ͍͠
    w 1)1ίʔυ্ͷ໰୊ͱ͔͋ͬͨΓ͢Δ͔༗ࣝऀͷҙݟΛฉ͖͍ͨ
    ؾʹͳ͍ͬͯΔ͜ͱ

    View full-size slide

  17. ࣍ճͷࢀߟ࣮૷Ҡ২ʹ
    ཱީิ͠·ͤΜ͔ʁ
    ʢࢲ΋༨༟͕͋Ε͹Ԡื͢Δͭ΋Γʣ

    View full-size slide