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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yusuke Ito
June 27, 2017
Programming
650
0
Share
Server Side Swiftを しばらく運用してみた話
Yusuke Ito
June 27, 2017
More Decks by Yusuke Ito
See All by Yusuke Ito
Macとオーディオ再生 2024/11/02
yusukeito
0
1.4k
おうちHackを取り入れた リノベーション事例
yusukeito
0
930
Swift からword2vecを 使ってみる
yusukeito
0
1.1k
Swift Outside the Box
yusukeito
1
2.9k
SwiftでgRPCとProtocolBuffersを使う
yusukeito
4
1.5k
Swift on Raspberry Pi でI2Cデバイスを使う
yusukeito
1
730
Isomorphic Swift
yusukeito
2
680
Swiftの値付きEnumをHackする
yusukeito
0
430
Swift プロトコル指向なCのラッパーを作る
yusukeito
3
1.3k
Other Decks in Programming
See All in Programming
Road to RubyKaigi: Play Hard(ware)
makicamel
1
560
継続的な負荷検証を目指して
pyama86
3
1k
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
19k
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
150
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
200
【26新卒研修】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
150
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
250
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
140
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
430
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Git: the NoSQL Database
bkeepers
PRO
432
67k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
200
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Fireside Chat
paigeccino
42
3.9k
Code Review Best Practice
trishagee
74
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
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αʔόʔܥαʔόʔϨεΞʔΩςΫνϟͳΒ͍ ͚Δ͔