Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
mastodonのnodeのはなし
Search
geta6
April 26, 2017
0
2.9k
mastodonのnodeのはなし
geta6
April 26, 2017
Tweet
Share
More Decks by geta6
See All by geta6
pixiv SketchのSSRの話
geta6
10
4k
ReactとFluxのこと
geta6
166
63k
What is CoffeeScript
geta6
8
820
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Done Done
chrislema
181
16k
GraphQLとの向き合い方2022年版
quramy
43
13k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Thoughts on Productivity
jonyablonski
67
4.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Scaling GitHub
holman
458
140k
A Tale of Four Properties
chriscoyier
156
23k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Transcript
ͳΜ͔OPEFͷ$16༻͕ ͰுΓ͍ͯͯϚδϠ ό͔ͬͨͷͰͳΜͱ͔ͨ͠
w ໊લɿ͛ͨ w ৬ۀɿҰൠϊʔϚϧΤϯδχΞ w +BWB4DSJQUమ๒ۄͱ͍ͯ͠ΖΜͳϓϩδΣΫτʹಥͬ ࠐ·ΕΔΛ͍ͯ͠·͢ɺීஈQJYJW4LFUDIͰ8FC ͷ࣮Λ͍ͯ͠·͢ HFUB
w ϦϦʔεޙɺ༵ۚͷ࣌͝Ζͷ͜ͱ
w ʮͳΜ͔OPEFͷ$16༻͕ͰுΓ͍ͯͯ ϚδϠό͍ʯ w ʮͳΜ͔λΠϜϥΠϯ͕खΕͯΔͧʯ
w Կͱ͔͠Α͏ɺͬͯݴͬͯԿͱ͔ͨ͠Λ͠·͢
w 8FC4PDLFUΛͬͨ4USFBNJOHؔ࿈ͷ"1*࣮ɺ શͯ̍ϑΝΠϧͷϙΤϜͰ࣮ݱ͞Ε͍ͯΔ w QHTRMίωΫγϣϯϓʔϧɺSFEJTίωΫγϣϯɺIUUQ ΠϯλʔϑΣʔεɺXTΠϯλʔϑΣʔεɺʑ
w OQNTDSJQUΛΑ͘ݟΔͱɺ͜ͷ࣮͕CBCFMOPEF ίϚϯυΛͬͯ&4ίʔυΛىಈ͢Δے ྗӡ༻ํࣜʹͳ͍ͬͯΔ͜ͱ͕Θ͔Δ w ಛʹQNͳͲͷϚωʔδϟʔڬΜͰ͍ͳ͍
w ͱ͜ΖͰOPEFγϯάϧεϨου w ίΞͷҧ͍ͰύϑΥʔϚϯεมΘΒͳ͍
w ݩͷίʔυૉͳ࣮ɺαʔόʔ͋ͨΓϓϩη εɺͭ·ΓίΞ͔͠ར༻Ͱ͖ͳ͍ঢ়ଶͰཱ͔͠ ͯΒΕͳ͍ w $16ෛՙ͕ภͬͨঢ়ଶʹͳΔ
w $16ෛՙ͕ภͬͨঢ়ଶ w ϚετυϯΛಈ͔ͯ͠Δαʔόʔతʹશવେৎ ͳϋζͳͷʹOPEFͷϓϩηε͚͕ͩͰு Γ͍ͯࢮɺͱ͍͏ঢ়ଶͷ͜ͱ w ͭͷίΞΛूதతʹࡴ͠ʹ͔͔Δ
1 3 2 4
w Կ͕ى͖Δ͔ w ϖʔδී௨ʹݟ͑Δͷʹɺͳ͔ͥετϦʔϛϯ ά͕߱ͬͯ͜ͳ͍ w λΠϜϥΠϯ͕ΊͪΌͪ͘ΌΕͯΔ
w Ͳ͏ͬͯղܾ͢Δ͔ w ϓϩηεΛ૿ͯ͠εέδϡʔϦϯά ɺϚγϯ ͷίΞؒͰෛՙΛࢄ͢Δ w ఆੴͱͯ͠QNͳͲͷϓϩηεϚωʔδϟʔΛͬ ͯɺ͍͍ײ͡ʹOPEFͷϓϩηεΛ૿ͯ͋͛͠Δ w
ࡴ͢ྗΛʹͯ͠Δ
1 3 2 4
w खͬऔΓૣ͘QNͰ࣮ݱ͠Α͏ͱͨ͠ w QNͷDPOpHpMFॻ͍ͯྡʹ͍ͨTVEPFSʹͨ͠ w ʮͳΜ͔ಈ͔ͳ͍Μ͚ͩͲʯ
w ϩάΛړͬͨΓ৭ʑͨ͠ΒɺͲ͏ΒTZTUFNEͱ૬ ੑ͕ѱ͘͏·͘ಈ͍͍ͯͳ͍Β͍͜͠ͱ͕Θ͔ͬͨ ʢΓํ͕ѱ͔͔ͬͨ͠Εͳ͍ʣ
w ͏ϦϦʔεͨ͠ޙɺϢʔβʔ͕ࠔͬͯΔͷࠓ w ղܾ͕࠷༏ઌɺ͏ےྗͰղܾ͠Α͏
w ࠷खͬऔΓૣ͘OPEFΛϚϧνίΞʹରԠͤ͞Δ ʹɺDMVTUFSϞδϡʔϧΛ͏ w OPEFʹඪ४Ͱόϯυϧ͞Ε͍ͯΔϞδϡʔϧ w ΫϥελϦϯάػೳΛ࣋ͬͨϓϩηεϚωʔδϟʔ ͷجૅʹͳ͍ͬͯΔ
None
w ಋೖͱͯ؆୯ɺSFRVJSFͯ͠JGจॻ͍ͯϝιου Λݸ࣮ߦ͢Δ͚ͩ
const cluster = require('cluster'); if (cluster.isMaster) { cluster.fork(); } else
{ // your code here }
w ͜ͷ··ͰίΞ͔͑͠ͳ͍ w ίΞ ճɺGPSLΛ࣮ߦ͢ΕΑ͍
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 }
w ͜ΕͰΕͯϚϧνίΞΛશ෦͍͖ΕΔΑ͏ʹͳ Γ·ͨ͠ w ίΞ ͍ͯ͠ΔͷGPSLͨ͠ϓϩηε͕രൃ͠ ͨ࣌ʹϚγϯ͕ਧͬඈͳ͍Α͏ʹ͢ΔͨΊͰ͢
w GPSLݩ͕NBTUFSɺGPSLઌ͕XPSLFS w XPSLFSͷࣄͷׂΓৼΓ04͕উखʹͬͯ͘ Ε·͢ʢϥϯυϩϏϯબͰ͖·͢ʣ
w ʢ͜͜ʹϓϩηεͷෛՙ͕͍͍ײ͡ʹݮ͍ͬͯΔ༷ ࢠ͕ݟͯऔΕΔඒ͍͠άϥϑΛஔ͘ʣ
w *NQSPWFTUSFBNJOH"1*TFSWFSQFSGPSNBODFXJUI DMVTUFS w ຊՈʹऔΓࠐ·Ε·ͨ͠ɺWͰϦϦʔε͞Εͯ ͍·͢ͷͰօ͞Μͥͻ͝ར༻͍ͩ͘͞
None
w تΜͰΒ͑ͯͳʹΑΓ
w ͓·͚ w ͋ͱͭϚʔδ͞Εͨͷ͕͋ΔͷͰհ͠·͢
w "EEIBT.PSFpFMEUPBDDPVOUUJNFMJOFUPCMPDL MBSHFBNPVOUPG9)3
w εΫϩʔϧ͕λΠϜϥΠϯͷඌ౸ୡͨ࣌͠ʹແ ݶʹ9)3ϦΫΤετ͕ΔͷΛ੍ͨ͠
w ͨͿΜ࣮Εɺ3FEVYͷ"DUJPO3FEVDFSʹOFYU VSM͕ଘࡏ͠ͳ͍࣌ͷॲཧΛ͍Εͨ
w "VUPNBUJDBMMZDIBOHFUIFTJ[FPGUFYUBSFB
w ͍จষΛೖྗͨ࣌͠ʹɺUPPU͢Δ࣌ͷUFYUBSFBͷ αΠζ͕ࣗಈతʹมΘΔΑ͏ʹͨ͠ w UFYUBSFBͷBVUPSFTJ[F؆୯ɺߦͰ࣮ݱͰ͖Δ
onChange (e) { e.target.style.height = 'auto'; e.target.style.height = `${e.target.scrollHeight}px`; },
onChange (e) { e.target.style.height = 'auto'; e.target.style.height = `${e.target.scrollHeight}px`; },
ߦΛݮΒ࣌͢ͷॲཧ ☝ߦΛ૿࣌͢ͷॲཧ
w ͓͠·͍Ͱ͢