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
600
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.1k
おうちHackを取り入れた リノベーション事例
yusukeito
0
710
Swift からword2vecを 使ってみる
yusukeito
0
1.1k
Swift Outside the Box
yusukeito
1
2.5k
SwiftでgRPCとProtocolBuffersを使う
yusukeito
4
1.4k
Swift on Raspberry Pi でI2Cデバイスを使う
yusukeito
1
670
Isomorphic Swift
yusukeito
2
610
Swiftの値付きEnumをHackする
yusukeito
0
330
Swift プロトコル指向なCのラッパーを作る
yusukeito
3
1.3k
Other Decks in Programming
See All in Programming
Qiita Bash
mercury_dev0517
2
220
インプロセスQAにおいて大事にしていること / In-process QA Meetup
medley
0
140
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
1
170
複雑なフォームの jotai 設計 / Designing jotai(state) for Complex Forms #layerx_frontend
izumin5210
6
1.5k
開発者フレンドリーで顧客も満足?Platformの秘密
algoartis
0
160
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
200
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.2k
ComposeでWebアプリを作る技術
tbsten
0
130
M5UnitUnified 最新動向 2025/05
gob
0
120
七輪ライブラリー: Claude AI で作る Next.js アプリ
suneo3476
1
170
「理解」を重視したAI活用開発
fast_doctor
0
270
API for docs
soutaro
3
1.6k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
How STYLIGHT went responsive
nonsquared
100
5.5k
Automating Front-end Workflow
addyosmani
1370
200k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Faster Mobile Websites
deanohume
306
31k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Cult of Friendly URLs
andyhume
78
6.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
179
53k
What's in a price? How to price your products and services
michaelherold
245
12k
Into the Great Unknown - MozCon
thekraken
38
1.7k
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αʔόʔܥαʔόʔϨεΞʔΩςΫνϟͳΒ͍ ͚Δ͔