AWSでWordPressのスケールアウト

 AWSでWordPressのスケールアウト

2019/1/26に開催されました、PHPカンファレンス仙台で登壇した時の資料です。

652359244199b2b5108a5e09c027e0da?s=128

Kanazawa Yuki

January 26, 2019
Tweet

Transcript

  1. 1)1ΧϯϑΝϨϯεઋ୆      . : : K

    :ERS /
  2. 1)1ΧϯϑΝϨϯεઋ୆ 2 i Pd WR W N E S +)

    S HJ +(+ S )&) HJ a J A C + 0 152 0
  3. 1)1ΧϯϑΝϨϯεઋ୆ ϥϯαʔζͷ঺հ

  4. 1)1ΧϯϑΝϨϯεઋ୆  T O I c T U eRY R

    E K OF R 8 :5 7 9 a a 20/43 1 .2 a1 -
  5. 1)1ΧϯϑΝϨϯεઋ୆    API     

    Freelance Basics     !    
  6. 1)1ΧϯϑΝϨϯεઋ୆ DN - D D F D D 7 A

    57 A - - - - - F D D G B . F DM DQ 7 2 W BLMPSH Aurora WordPress S3 deploy
  7. 1)1ΧϯϑΝϨϯεઋ୆ 7  

  8. 1)1ΧϯϑΝϨϯεઋ୆ ຊηογϣϯͷର৅ऀ

  9. 1)1ΧϯϑΝϨϯεઋ୆         

            "!
  10. 1)1ΧϯϑΝϨϯεઋ୆      

  11. 1)1ΧϯϑΝϨϯεઋ୆    

  12. 1)1ΧϯϑΝϨϯεઋ୆ A W P e W S d e o

    W r A r A e
  13. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region L S H M H

    G DB on Instance QP W a B : / / / : 22 ( . 1 2 )
  14. 1)1ΧϯϑΝϨϯεઋ୆ εέʔϧΞ΢τͷ՝୊

  15. 1)1ΧϯϑΝϨϯεઋ୆ 2

  16. 1)1ΧϯϑΝϨϯεઋ୆ 1 1 wp-content/uploads/ 1

  17. 1)1ΧϯϑΝϨϯεઋ୆ 1 1 1 wp-content/plugins/ 1

  18. 1)1ΧϯϑΝϨϯεઋ୆ - - wp-cron wp-cron

  19. 1)1ΧϯϑΝϨϯεઋ୆        /var/log/nginx/access.log /var/log/nginx/access.log

  20. 1)1ΧϯϑΝϨϯεઋ୆ εέʔϧΞ΢τͷ४උ

  21. 1)1ΧϯϑΝϨϯεઋ୆ 71$ͱαϒωοτͷߏங

  22. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region EC VPC Public subnet Elastic

    IP Address G I WordPress
  23. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region D VPC Public subnet Elastic

    IP Address 3 S 3 S BL AL C5 RPN WordPress 3
  24. 1)1ΧϯϑΝϨϯεઋ୆ ϩʔυόϥϯαͷ௥Ճͱ)5514Խ

  25. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region 2 E VPC Public subnet

    Private subnet 2 C WordPress 2 L 2 L 2 2 A B C
  26. 1)1ΧϯϑΝϨϯεઋ୆ ngi ) odfodM wRT P O u P w

    L CE E - C 22 s P eamnh_ p L) C E F EX 2 C D A c i L AC C DDc EEB 22 vX W r EEBD bed rS L 22 . ()( .2. HB A B BX t WordPress users ; A ) ) ' ()( $ !! ) ) ' ()( && $ ) ) & = EEBD 22 EEB Certificate manager SSL FDE
  27. 1)1ΧϯϑΝϨϯεઋ୆ σʔλϕʔεͷ෼཭

  28. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region VPC Public subnet Private subnet

    Private subnet DB Instance WordPress
  29. 1)1ΧϯϑΝϨϯεઋ୆ f Q I Pf uD iR D l a

    R ry dS Se a ry f D xMI t y L xMI D B ci dS uo m D QS i H B 51 d f 55 d n HB B g S AP I s
  30. 1)1ΧϯϑΝϨϯεઋ୆ ΞοϓϩʔυσΟϨΫτϦͷ෼཭

  31. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region VPC Public subnet Private subnet

    Private subnet DB Instance S3 WordPress S / - - S 3/ - - W
  32. 1)1ΧϯϑΝϨϯεઋ୆ 3 - 3.3 ; ) *, - > 3

    3>>3C => A > '( 3 3 C '( > 3 C '(
  33. 1)1ΧϯϑΝϨϯεઋ୆ 22 SP_ dLo au 9 W UOp O Ie

    9 L s 9 QRT Is NLE lf m It L s M 3 32= 2:921= 69 3;= 69=: V A ORSMFS ORSA E MFS A FW MFS AU LTF" 1 3 ORSA E M ON A N O . . R.,. CT FS /R.( . _ /R. . FW /R. LFNHSI MFS AU LTF" )- . VO E FRR'V ONSFNS'T LO ER' MFS AU LTF /R.,. FH ON /R.(+. NO SIF RS ( / "/ " 1 F O E 4;: VO E FRR V A ORSMFS 3;3 MFS A FW AV A SS IFEA LF / TL qi q
  34. 1)1ΧϯϑΝϨϯεઋ୆ O PM L 3

  35. 1)1ΧϯϑΝϨϯεઋ୆ ϩάͷू໿

  36. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region VPC Public subnet Private subnet

    Private subnet DB Instance S3 - WordPress Log 3 / / / / L L
  37. 1)1ΧϯϑΝϨϯεઋ୆ AWS Cloud AWS Region /3 / L VPC Public

    subnet Private subnet Private subnet DB Instance S3 Wordpress with CloudWatch Lambda function / /3 / C
  38. 1)1ΧϯϑΝϨϯεઋ୆ L /3 / . =.= - 5 . 5/

    . . = =.= . 5 .00 .= =5 - .= / 5 . 5 .00 / - .=5 %$$$ - = . - . 5 =. 0 -5 5 5=5. -: 5=5 =. =- - 5 - :- . : . 5 . 5 .= =5 - .= / 5 . 5 / - .=5 %$$$ - = . - . 5 =. 0 -5 5 5=5. -: 5=5 =. =- - 5 - :- . : . 5 /3 / C / / /. / / / 5 =. .
  39. 1)1ΧϯϑΝϨϯεઋ୆ 1 C 3 A

  40. 1)1ΧϯϑΝϨϯεઋ୆ ؅ཧ༻αʔόʔͷߏங

  41. 1)1ΧϯϑΝϨϯεઋ୆ gem c B i p c gem d lN

    /- . - n LAP AA ao . h n users DB Instance Wordpress Wordpress Wordpress admin /- . - A Il -
  42. 1)1ΧϯϑΝϨϯεઋ୆ ϓϥάΠϯ௥ՃͱΞοϓσʔτͷରࡦ

  43. 1)1ΧϯϑΝϨϯεઋ୆ 4G 2 3 P 4 4 2 3.. 1

    . G users DB Instance Wordpress Wordpress Developer 4C 3 2 2 31 2 3.. Wordpress Admin 1 . 2 3..
  44. 1)1ΧϯϑΝϨϯεઋ୆ users DB Instance Wordpress Wordpress Developer 3 2 2

    31 2 3 Wordpress Admin 14. 14. C
  45. 1)1ΧϯϑΝϨϯεઋ୆ HdH H tsno Aurora WordPress S3 H P up

    HdH 5 24 G g G / 202 .21 m G - HdH B : 24 G g G / D ABA l Hc 3 D B BA C 57A up ru MSU / 5 FB: A a eiH H G
  46. 1)1ΧϯϑΝϨϯεઋ୆ ͞ΒͳΔ֦ுͱ৑௕Խ

  47. 1)1ΧϯϑΝϨϯεઋ୆ I M A users DB Instance Wordpress Wordpress Auto

    Scaling group
  48. 1)1ΧϯϑΝϨϯεઋ୆ H BD PS Al BP H R A Q

    B d M L o eas DB Instance Wordpress users Read Replica Read Replica A r p
  49. 1)1ΧϯϑΝϨϯεઋ୆ VPC Public subnet AWS Cloud Availability zone 1 AWS

    Region A Private subnet Private subnet DB Instance WordPress Public subnet Availability zone 2 Private subnet Private subnet WordPress B 2 D Read Replica
  50. 1)1ΧϯϑΝϨϯεઋ୆ VPC Public subnet AWS Cloud Availability zone 1 AWS

    Region A Private subnet Private subnet DB Instance WordPress Public subnet Availability zone 2 Private subnet Private subnet WordPress B 2 D DB Instance
  51. 1)1ΧϯϑΝϨϯεઋ୆ ࠷ޙʹ

  52. 1)1ΧϯϑΝϨϯεઋ୆ !  "    

  53. 1)1ΧϯϑΝϨϯεઋ୆ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ