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

Cygamesにおける長期運用のこれまでとこれから〜負荷対策とPHP7への道〜

Cygames
December 18, 2018

 Cygamesにおける長期運用のこれまでとこれから〜負荷対策とPHP7への道〜

2018/12/15 PHP Conference 2018

Cygames

December 18, 2018
Tweet

More Decks by Cygames

Other Decks in Technology

Transcript

  1. 1IBOͷར༻ྫ PhanParamTooFew Call with 1 arg(s) to \Foo::bar() which requires

    2 arg(s) defined at … ղੳ݁Ռ 1IBO1BSBN5PP'FXͷJTTVF͕ग़Δ ✤ ੩తղੳͷར༻ $this->load->library('foo');
 $this->foo->bar('param1'); 
 class Foo{ public function bar($a, $b){…} }
 σϑΥϧτ஋͕ͳ͍ ໰୊ͷ͋Δίʔυ Ҿ਺͕଍Γͳ͍͔ 34
  2. 36 $PEFJHOJUFSͷରԠྫ ✤ ੩తղੳͷར༻ /** * @property CI_input $input *

    @property MY_...... * @property Foo_class $foo * @property ..... */ class CI_Controller { /** * @return MY_Controller */ public static function &get_instance(){} ɾશΫϥε෼Λهࡌ
 ɾੜ੒όονΛ࡞ͬͨ
 ˞ઃఆྫʢҰ෦ʣ
  3. ɾ θϩঃࢉͷ݁Ռ ɾ Մมม਺ͷධՁॱ ɾ GPSFBDI಺Ͱͷ಺෦ϙΠϯλࢀর ɾ ࢀর౉͠ͷ໰୊ ɾ ͦͷଞଟ਺ʢৄࡉ͸1)1ͷมߋཤྺΛࢀরʣ


    ίϝϯτ΍Ϧςϥϧ಺Λল͍ͯ͘ΕΔ
 1)14UPSNͷݕࡧػೳ͕ศར
 40 1)1͔Βڍಈ͕͔Θͬͨ΋ͷΛ֬ೝ ✤ ໨ࢹͰͷ֬ೝ
  4. 44 ղܾྫ ✤ 8BSOJOH΍/PUJDFͷղফ class A{ function get($a){} } class

    B extends A{ function get($a, $b){} } ΦʔόʔϥΠυͨ͠ϝιο υͷҾ਺͕ҧ͏
 XBSOJOH͕ൃੜ͢Δ 1IBO1BSBN4JHOBUVSF.JTNBUDIΛใࠂ ղੳ݁Ռ
  5. 51  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  6. 52  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  7. 56  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  8. 60  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  9. 73  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  10. 75  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ
  11. Ωϟογϡ͔Β࿈૝഑ྻΛऔΓग़͢ॴ͕஗͘ͳΔ 84 ݪҼɿ$47ͷංେԽ ΩϟϥΫλʔσʔλ
 ಡΈࠐΈޙͷϝϞϦαΠζ ϝϞϦ.# ✤഑ྻͷಡΈࠐΈվળ $charaData = [

    110001 => [ 'name' => '໊લ', 'type' => 1, 'param1' => 1001, 'param2' => 1002, ], 110002 => [ ݩσʔλ͸$47 ։ൃ্ͷखܰ͞ͷ໰୊
  12. վमΠϝʔδ ɾ ΦϒδΣΫτܕʹมߋ͢Δ ɾ HFU࣌ʹϔομͱΧϥϜΛBSSBZ@DPNCJOF ɾ ΠςϨʔλΛ࣮૷͠ϧʔϓͰ͖ΔΑ͏ʹ 86 ಡΈࠐΈ࣌Λܰ͘͢Δ޻෉ ✤

    ഑ྻͷಡΈࠐΈվળ ࢖༻Πϝʔδ
 DIBSB@EBUBDTW-PBEMPBE DIBSB@EBUBDTW  DIBSBDIBSB@EBUBHFU JE 
 DIBSB<OBNF>Ͱ֤ΧϥϜʹΞΫηε
  13. 90 ϧʔϓதͷॲཧ΍഑ྻૢ࡞Λҙࣝ͢Δ ɾ ϧʔϓΛ܁Γฦ͞ͳ͍޻෉ ɾ ؔ਺ͷݺͼग़͠ΛݮΒ͢޻෉ ɾ GPSFBDIͰͰ͖Δࣄ͸GPSFBDIΛਪ঑ ✤ ͦͷଞࡉ͔ͳରԠ

    $cols = array_column($list, 'col'); foreach ($list as $val) {....} ݁ہޙ͔Βϧʔϓ͢Δࣄ͕ଟ͍
 ͦͷ࣌ʹϦϑΝΫλϦϯά͕Ͱ͖Δͱ͸ݶΒͳ͍
  14. 92  ͸͡Ίʹ  ࢖༻πʔϧͷ঺հ  ໰୊఺΁ͷΞϓϩʔν  मਖ਼ͷࡍʹ 

    ࣄྫ঺հ  ରࡦޙʹߦ͏͜ͱ ✤ ෛՙରࡦʹ͍ͭͯ