nginxのパフォーマンスチューニング

 nginxのパフォーマンスチューニング

@shibuya.pm#17

5d74d743eabd2bf7d4d2f68b9d3c727d?s=128

Tatsuhiko Kubo

June 02, 2015
Tweet

Transcript

  1. 2.

    @cubicdaiya / Tatsuhiko Kubo w 4PGUXBSF&OHJOFFSJO*OGSBTUSVDUVSF &OHJOFFSJOH!.FSDBSJ *OD w "VUIPSPGOHJOYCVJME

    w OHJOYSEQBSUZNPEVMFEFWFMPQFS w OHY@TNBMM@MJHIU OHY@EZOBNJD@VQTUSFBN FUDʜ w 'BWPSJUFT(P $ -VB OHJOY OHY@MVB
  2. 18.

    TCP_NODELAYͱTCP_NOPUSH w ͜ͷೋͭ͸ຊདྷ૬൓͢Δಈ࡞Λ͢Δ w 5$1@/0%&-": w ύέοτΛͰ͖Δ͚ͩଈ࠲ʹૹ৴͢Δ w 5$1@/0164) w

    ύέοτΛͰ͖Δ͚ͩ·ͱΊͯૹ৴͢Δ w OHJOY͸྆ํ૊Έ߹ΘͤՄೳ ཁTFOEpMF  w ·ͣɺύέοτૹ৴Λ5$1@/0164)Ͱ஗Ԇͤ͞Δ 5$1@/0164)ΛPGG5$1@/0%&-":Ͱϑϥογϡ
  3. 24.

    nginx.conf(࠷దԽલ) XPSLFS@QSPDFTTFT FWFOUT\ XPSLFS@DPOOFDUJPOT ^ IUUQ\ JODMVEFNJNFUZQFT EFGBVMU@UZQFBQQMJDBUJPOPDUFUTUSFBN BDDFTT@MPHPGG TFOEpMFPO

    LFFQBMJWF@UJNFPVU TFSWFS\ MJTUFO TFSWFS@OBNFMPDBMIPTU MPDBUJPO\ SPPUIUNM JOEFYJOEFYIUNMJOEFYIUN ^ ^ ^
  4. 25.

    nginx.conf(࠷దԽޙ) XPSLFS@QSPDFTTFT FWFOUT\ XPSLFS@DPOOFDUJPOT BDDFQU@NVUFY@EFMBZNT ^ IUUQ\ JODMVEFNJNFUZQFT EFGBVMU@UZQFBQQMJDBUJPOPDUFUTUSFBN BDDFTT@MPHPGG

    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