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
Server Side Swiftを しばらく運用してみた話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yusuke Ito
June 27, 2017
Programming
0
640
Server Side Swiftを しばらく運用してみた話
Yusuke Ito
June 27, 2017
Tweet
Share
More Decks by Yusuke Ito
See All by Yusuke Ito
Macとオーディオ再生 2024/11/02
yusukeito
0
1.4k
おうちHackを取り入れた リノベーション事例
yusukeito
0
890
Swift からword2vecを 使ってみる
yusukeito
0
1.1k
Swift Outside the Box
yusukeito
1
2.8k
SwiftでgRPCとProtocolBuffersを使う
yusukeito
4
1.4k
Swift on Raspberry Pi でI2Cデバイスを使う
yusukeito
1
710
Isomorphic Swift
yusukeito
2
670
Swiftの値付きEnumをHackする
yusukeito
0
410
Swift プロトコル指向なCのラッパーを作る
yusukeito
3
1.3k
Other Decks in Programming
See All in Programming
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
160
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
230
AHC061解説
shun_pi
0
330
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
210
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
210
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.4k
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
230
CSC307 Lecture 13
javiergs
PRO
0
310
Windows on Ryzen and I
seosoft
0
140
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
1
820
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
240
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
340
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Utilizing Notion as your number one productivity tool
mfonobong
4
250
Bash Introduction
62gerente
615
210k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
150
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Speed Design
sergeychernyshev
33
1.6k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
230
Code Reviewing Like a Champion
maltzj
528
40k
Transcript
S E R V E R S I D E
S W I F T Λ ͠ Β ͘ ӡ ༻ ͯ͠ Έ ͨ T O K Y O S E R V E R S I D E S W I F T M E E T U P # 8 Yusuke ItoɾനϠΪίʔϙϨʔγϣϯ novi 2017/06/27
χϡʔεΩϡϨʔγϣϯApp اۀ͚API
Minutes(λΠϚʔAppͰ͢)
S E R V E R - S I D
E S W I F T ӡ ༻ ɾ ࢼ ݧ த ͷ α ʔ Ϗ ε • ΫϩʔϦϯάΛߦͳ͏σʔϞϯ(Ϋϩʔϥʔ) • Ұͭ: 30kߦ • ೋͭ: 2~3000ߦ • gRPCϕʔεͷαʔόʔ • ͲͪΒSwift 3.1.1Λ༻
t r y ! S w i f t ʹ
ͯ … RDS ECS(EC2 Container Service)
D O C K E R Ͱ C U R
L ͕ ಈ ͔ ͳ ͍ • cURLΛ͏ϥΠϒϥϦ͕Unknown Error·ͨམͪΔ • URLSession • shiroyagicorp/swift-seeurl • Docker on macOS: ⭕, Docker on AWS(ECS): Crash • Docker → • libcurl4-openssl-devͰͳ͘libcurl4-gnutls-devΛ͏
T I M E Z O N E ܥ A
P I ͕ ಈ ͔ ͳ ͍ • TimeZone(abbreviation: "JST") => nil ʹͳΔ • λΠϜκʔϯͷϑΝΠϧ͕DockerΠϝʔδʹೖ͍ͬͯ ͳ͍ • apt install tzdata ͢Δ (SR-4921) • SwfitͷDockerΠϝʔδΛެ͔ࣜΒϑΥʔΫͯࣗ͠ Ͱ࡞Δ
G R P C α ʔόʔ ͕ མ ͪ Δ
• AWS(ECS)ʹஔ͍ͯ1࣌ؒ͘Β͍ͯ͠ΞΫηε͢Δͱؾ ·͙ΕʹམͪΔ • XcodeσόοάϏϧυ&RunͰ࠶ݱ • Address Sanitizer, Thread sanitizer Λ͏ • gRPCϥΠϒϥϦपΓʹ͋Γͦ͏
M Y S Q L ͕ σ ο υ ϩ
ο Ϋ • (Swiftؔ͋Γ·ͤΜ) • SHOW ENGINE INNODB STATUS ; Ͱ࠷ޙʹى͖ͨ σουϩοΫΛදࣔ • BULK INSERT࣌ͷσουϩοΫͬΆ͍ • ݪҼ: autocommit = 1 or 0; ͷ͍ํ͕ؒҧͬͯͨ
ϝϞ Ϧ Ϧ ʔ Ϋ ? • AWS(ECS)্ͰҰ൩ಈ͔͢ 200MB
ௐ ࠪ • InstrumentsΛ͏ • Memory Allocationଌఆπʔϧ • Xcodeͷπʔϧ͕͑ͯศར •
ϥϯλΠϜ(Linux or Darwin)͕ҧ͏ͷͰͦ͜ • ݪҼ·ͩௐࠪத
ผ ͷ α ʔ Ϗ ε Swift 3.1 (3.0.2ͷͱ͖͍ͬͯͨ͞ͷͰ҆ఆͨ͠)
· ͱ Ί • gRPCϥΠϒϥϦ·ͩඍົ • Protocol BuffersΑ͍(Swift͔Βศརʹ͑Δ) • શੈքతʹSwiftͷӡ༻ϊϋ͕গͳ͍
• WebαʔόʔܥαʔόʔϨεΞʔΩςΫνϟͳΒ͍ ͚Δ͔