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
Yusuke Ito
June 27, 2017
Programming
0
560
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
370
おうちHackを取り入れた リノベーション事例
yusukeito
0
630
Swift からword2vecを 使ってみる
yusukeito
0
1k
Swift Outside the Box
yusukeito
1
2.4k
SwiftでgRPCとProtocolBuffersを使う
yusukeito
4
1.3k
Swift on Raspberry Pi でI2Cデバイスを使う
yusukeito
1
640
Isomorphic Swift
yusukeito
2
580
Swiftの値付きEnumをHackする
yusukeito
0
290
Swift プロトコル指向なCのラッパーを作る
yusukeito
3
1.3k
Other Decks in Programming
See All in Programming
CSC509 Lecture 11
javiergs
PRO
0
180
受け取る人から提供する人になるということ
little_rubyist
0
250
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
イベント駆動で成長して委員会
happymana
1
330
Better Code Design in PHP
afilina
PRO
0
130
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
CSC509 Lecture 12
javiergs
PRO
0
160
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Bash Introduction
62gerente
608
210k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Docker and Python
trallard
40
3.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Cult of Friendly URLs
andyhume
78
6k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
100
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
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αʔόʔܥαʔόʔϨεΞʔΩςΫνϟͳΒ͍ ͚Δ͔