mastodonのnodeのはなし

019c906aa98e907cc7951cab7d4850ea?s=47 geta6
April 26, 2017
2.2k

 mastodonのnodeのはなし

019c906aa98e907cc7951cab7d4850ea?s=128

geta6

April 26, 2017
Tweet

Transcript

  1. ͳΜ͔OPEFͷ$16࢖༻཰͕ ͰுΓ෇͍ͯͯϚδϠ ό͔ͬͨͷͰͳΜͱ͔ͨ͠࿩

  2. w ໊લɿ͛ͨ w ৬ۀɿҰൠϊʔϚϧΤϯδχΞ w +BWB4DSJQUమ๒ۄͱ͍ͯ͠ΖΜͳϓϩδΣΫτʹಥͬ ࠐ·ΕΔ܎Λ͍ͯ͠·͢ɺීஈ͸QJYJW4LFUDIͰ8FC ͷ࣮૷Λ͍ͯ͠·͢ HFUB

  3. w ϦϦʔε௚ޙɺ༵ۚ೔ͷ࣌͝Ζͷ͜ͱ

  4. w ʮͳΜ͔OPEFͷ$16࢖༻཰͕ͰுΓ෇͍ͯͯ ϚδϠό͍ʯ w ʮͳΜ͔λΠϜϥΠϯ͕ख஗ΕͯΔͧʯ

  5. w Կͱ͔͠Α͏ɺͬͯݴͬͯԿͱ͔ͨ͠࿩Λ͠·͢

  6. w 8FC4PDLFUΛ࢖ͬͨ4USFBNJOHؔ࿈ͷ"1*࣮૷͸ɺ શͯ̍ϑΝΠϧͷϙΤϜͰ࣮ݱ͞Ε͍ͯΔ w QHTRMίωΫγϣϯϓʔϧɺSFEJTίωΫγϣϯɺIUUQ ΠϯλʔϑΣʔεɺXTΠϯλʔϑΣʔεɺ౳ʑ

  7. w OQNTDSJQUΛΑ͘ݟΔͱɺ͜ͷ࣮૷͕CBCFMOPEF ίϚϯυΛ࢖ͬͯ&4ίʔυΛ௚઀ىಈ͢Δے ྗӡ༻ํࣜʹͳ͍ͬͯΔ͜ͱ͕Θ͔Δ w ಛʹQNͳͲͷϚωʔδϟʔ͸ڬΜͰ͍ͳ͍

  8. w ͱ͜ΖͰOPEF͸γϯάϧεϨου w ίΞ਺ͷҧ͍ͰύϑΥʔϚϯε͸มΘΒͳ͍

  9. w ݩͷίʔυ͸ૉ௚ͳ࣮૷ɺαʔόʔ͋ͨΓϓϩη εɺͭ·ΓίΞ෼͔͠ར༻Ͱ͖ͳ͍ঢ়ଶͰཱ͔͠ ͯΒΕͳ͍ w $16ෛՙ͕ภͬͨঢ়ଶʹͳΔ

  10. w $16ෛՙ͕ภͬͨঢ়ଶ w ϚετυϯΛಈ͔ͯ͠Δαʔόʔతʹ͸શવେৎ ෉ͳϋζͳͷʹOPEFͷϓϩηε͚͕ͩͰு Γ෇͍ͯࢮɺͱ͍͏ঢ়ଶͷ͜ͱ w ͭͷίΞΛूதతʹࡴ͠ʹ͔͔Δ

  11. 1 3 2 4

  12. w Կ͕ى͖Δ͔ w ϖʔδ͸ී௨ʹݟ͑Δͷʹɺͳ͔ͥετϦʔϛϯ ά͕߱ͬͯ͜ͳ͍ w λΠϜϥΠϯ͕ΊͪΌͪ͘Ό஗ΕͯΔ

  13. w Ͳ͏΍ͬͯղܾ͢Δ͔ w ϓϩηε਺Λ૿΍ͯ͠εέδϡʔϦϯά ɺϚγϯ ಺ͷίΞؒͰෛՙΛ෼ࢄ͢Δ w ఆੴͱͯ͠͸QNͳͲͷϓϩηεϚωʔδϟʔΛ࢖ͬ ͯɺ͍͍ײ͡ʹOPEFͷϓϩηε਺Λ૿΍ͯ͋͛͠Δ w

    ࡴ͢ྗΛʹͯ͠΍Δ
  14. 1 3 2 4

  15. w खͬऔΓૣ͘QNͰ࣮ݱ͠Α͏ͱͨ͠ w QNͷDPOpHpMFॻ͍ͯྡʹ͍ͨTVEPFSʹ౉ͨ͠ w ʮͳΜ͔ಈ͔ͳ͍Μ͚ͩͲʯ

  16. w ϩάΛړͬͨΓ৭ʑͨ͠ΒɺͲ͏΍ΒTZTUFNEͱ૬ ੑ͕ѱ͘͏·͘ಈ͍͍ͯͳ͍Β͍͜͠ͱ͕Θ͔ͬͨ ʢ΍Γํ͕ѱ͔͔ͬͨ΋͠Εͳ͍ʣ

  17. w ΋͏ϦϦʔεͨ͠ޙɺϢʔβʔ͕ࠔͬͯΔͷ͸ࠓ w ղܾ͕࠷༏ઌɺ΋͏ےྗͰղܾ͠Α͏

  18. w ࠷΋खͬऔΓૣ͘OPEFΛϚϧνίΞʹରԠͤ͞Δ ʹ͸ɺDMVTUFSϞδϡʔϧΛ࢖͏ w OPEFʹඪ४Ͱόϯυϧ͞Ε͍ͯΔϞδϡʔϧ w ΫϥελϦϯάػೳΛ࣋ͬͨϓϩηεϚωʔδϟʔ ͷجૅʹͳ͍ͬͯΔ

  19. None
  20. w ಋೖ͸ͱͯ΋؆୯ɺSFRVJSFͯ͠JGจॻ͍ͯϝιου Λݸ࣮ߦ͢Δ͚ͩ

  21. const cluster = require('cluster'); if (cluster.isMaster) { cluster.fork(); } else

    { // your code here }
  22. w ͜ͷ··Ͱ͸ίΞ͔͠࢖͑ͳ͍ w ίΞ਺ ճɺGPSLΛ࣮ߦ͢Ε͹Α͍

  23. const cluster = require('cluster'); const os = require('os'); if (cluster.isMaster)

    { const core = Math.max(os.cpus().length - 1, 1); for (let i = 0; i < core; i++) cluster.fork(); } else { // your code here }
  24. w ͜ΕͰ੖ΕͯϚϧνίΞΛશ෦࢖͍͖ΕΔΑ͏ʹͳ Γ·ͨ͠ w ίΞ਺ ͍ͯ͠Δͷ͸GPSLͨ͠ϓϩηε͕രൃ͠ ͨ࣌ʹϚγϯ͕ਧͬඈ͹ͳ͍Α͏ʹ͢ΔͨΊͰ͢

  25. w GPSLݩ͕NBTUFSɺGPSLઌ͕XPSLFS w XPSLFS΁ͷ࢓ࣄͷׂΓৼΓ͸04͕উखʹ΍ͬͯ͘ Ε·͢ʢϥ΢ϯυϩϏϯ΋બ୒Ͱ͖·͢ʣ

  26. w ʢ͜͜ʹϓϩηεͷෛՙ͕͍͍ײ͡ʹݮ͍ͬͯΔ༷ ࢠ͕ݟͯऔΕΔඒ͍͠άϥϑΛஔ͘ʣ

  27.  w *NQSPWFTUSFBNJOH"1*TFSWFSQFSGPSNBODFXJUI DMVTUFS w ຊՈʹऔΓࠐ·Ε·ͨ͠ɺWͰϦϦʔε͞Εͯ ͍·͢ͷͰօ͞Μͥͻ͝ར༻͍ͩ͘͞

  28. None
  29. w تΜͰ΋Β͑ͯͳʹΑΓ

  30. w ͓·͚ w ͋ͱͭϚʔδ͞Εͨͷ͕͋ΔͷͰ঺հ͠·͢

  31.  w "EEIBT.PSFpFMEUPBDDPVOUUJNFMJOFUPCMPDL MBSHFBNPVOUPG9)3

  32. w εΫϩʔϧ͕λΠϜϥΠϯͷ຤ඌ΁౸ୡͨ࣌͠ʹແ ݶʹ9)3ϦΫΤετ͕૸ΔͷΛ཈੍ͨ͠

  33. w ͨͿΜ࣮૷๨Εɺ3FEVYͷ"DUJPO3FEVDFSʹOFYU VSM͕ଘࡏ͠ͳ͍࣌ͷॲཧΛ͍Εͨ

  34.  w "VUPNBUJDBMMZDIBOHFUIFTJ[FPGUFYUBSFB

  35. w ௕͍จষΛೖྗͨ࣌͠ʹɺUPPU͢Δ࣌ͷUFYUBSFBͷ αΠζ͕ࣗಈతʹมΘΔΑ͏ʹͨ͠ w UFYUBSFBͷBVUPSFTJ[F͸؆୯ɺߦͰ࣮ݱͰ͖Δ

  36. onChange (e) { e.target.style.height = 'auto'; e.target.style.height = `${e.target.scrollHeight}px`; },

  37. onChange (e) { e.target.style.height = 'auto'; e.target.style.height = `${e.target.scrollHeight}px`; },

    ߦ਺ΛݮΒ࣌͢ͷॲཧ ☝ߦ਺Λ૿΍࣌͢ͷॲཧ
  38. w ͓͠·͍Ͱ͢