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
520
おうちHackを取り入れた リノベーション事例
yusukeito
0
650
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
650
Isomorphic Swift
yusukeito
2
590
Swiftの値付きEnumをHackする
yusukeito
0
300
Swift プロトコル指向なCのラッパーを作る
yusukeito
3
1.3k
Other Decks in Programming
See All in Programming
103 Early Hints
sugi_0000
1
230
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
730
Exploring: Partial and Independent Composables
blackbracken
0
100
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
Security_for_introducing_eBPF
kentatada
0
110
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
480
良いユニットテストを書こう
mototakatsu
8
2.8k
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
850
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
선언형 UI에서의 상태관리
l2hyunwoo
0
180
Featured
See All Featured
Building Your Own Lightsaber
phodgson
103
6.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
What's in a price? How to price your products and services
michaelherold
243
12k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Side Projects
sachag
452
42k
A Tale of Four Properties
chriscoyier
157
23k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
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αʔόʔܥαʔόʔϨεΞʔΩςΫνϟͳΒ͍ ͚Δ͔