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
YAPC::Fukuoka lunch session
Search
Harukasan
PRO
July 01, 2017
Technology
1
2.9k
YAPC::Fukuoka lunch session
YAPC::Fukuoka ランチスポンサーセッション
2017-07-01
Harukasan
PRO
July 01, 2017
Tweet
Share
More Decks by Harukasan
See All by Harukasan
pixivを支える技術 / 技育CAMPアカデミア
harukasan
PRO
3
360
20240401 新卒研修 - ピクシブにおける技術領域
harukasan
PRO
1
680
ピクシブのコンテンツ配信基盤技術 / pixiv TECH SALON
harukasan
PRO
5
5.3k
Goにおける画像ファイル処理 / golang.tokyo #19
harukasan
PRO
7
6.4k
WebRTC動画をトランスコードする / Transcoding video streams from WebRTC
harukasan
PRO
5
1.5k
ImageFluxを支えるリモート開発 / 20171202
harukasan
PRO
2
1.7k
YAPC::Fukuoka 前夜祭LT / Yet Another Pawoo Commit logs
harukasan
PRO
0
2.9k
マストドン会議: Pawoo / Mastodon Kaigi2
harukasan
PRO
2
430
大規模Mastodonインスタンスを運用するコツ / Inside Pawoo Mastodon infrastructure
harukasan
PRO
0
3.1k
Other Decks in Technology
See All in Technology
Amazon ECS & AWS Fargate 今昔物語 / past and present stories of Amazon ECS and AWS Fargate
iselegant
18
3.8k
RDS for Db2 データ移行編 - Part2:S3経由のバックアップ・リストアでデータ移行 /20241011-RDSforDb2-dojo
mayumihirano
0
140
外部カンファレンスで登壇しよう! 〜「強い」エンジニアへの一歩を踏み出す〜
logica0419
4
130
Bluesky 2019〜2022
yamarten
1
120
Reality is not an End-to-End Prediction Problem: Applied NLP in the Age of Generative AI
inesmontani
PRO
0
110
Covariance, Contravariance & Diamond
alexdaubois
1
110
今日から始める技術的負債の解消
leveragestech
3
440
VueとViteで作るUIコンポーネントライブラリ ~デザインシステムとプロダクトの理想的な分離を目指して~ / 20241019_cloudsign_VueFesJapan2024_1
bengo4com
8
3.9k
Unlearn Modularity
lemiorhan
6
300
いまいまMySQL2024 @ OSC Nagaoka
sakaik
3
290
最新のWasm事情
askua
5
2.5k
40代後半で開発エンジニアからクラウドインフラエンジニアにキャリアチェンジし、生き残れる自信がようやく持てた話
iwamot
9
8.1k
Featured
See All Featured
Code Review Best Practice
trishagee
63
17k
Testing 201, or: Great Expectations
jmmastey
38
7k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Statistics for Hackers
jakevdp
796
220k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Faster Mobile Websites
deanohume
304
30k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
YesSQL, Process and Tooling at Scale
rocio
167
14k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
13
1.8k
How to Think Like a Performance Engineer
csswizardry
18
1k
Transcript
ଵଦͰ͋ΔΤϯδχΞͷͨΊͷΫϥυը૾มαʔϏε @harukasan / MICHII Shunsuke 2017-07-01 :"1$'VLVPLBϥϯνεϙϯαʔηογϣϯ
)BSVLBTBOಓҪढ़հ ϐΫγϒ ג ϦʔυΤϯδχΞ *NBHF'MVYࣄۀऀ ԬΦϑΟεͰͳ͘౦ژຊࣾۈ Ԭݝٱཹถࢢੜ·Ε ٱཹถߴઐˠେ ൧௩ ˠஜେӃˠϐΫγϒೖࣾ
3VCZͱ(Pͱ͢͜͠4DBMBΛॻ͘ΠϯϑϥܥΤϯδχΞ ීஈࣇͷ
None
࡞׆ಈ͕ͬͱָ͘͠ͳΔॴΛͭ͘Δ
None
ϥϯνηογϣϯ
None
ϖ Image ϖ Image ϖ Image ϖ Image ϖ Image
ϖ Image
ϨΠΞτΛม͍͑ͨ ৽͍͠αΠζͷαϜωΠϧ͕΄͍͠ ৽͍͠σόΠεʹରԠ͍ͨ͠ ͍··ͰͷαϜωΠϧͩͱখ͍͞ ͖Ε͍ʹݟ͑ΔΑ͏ʹ͍ͨ͠ ը࣭Λམͱͣ͞ʹॖখ͍ͨ͠ දࣔΛ͍ͨ͘͠ WebPͰ৴͍ͨ͠
զʑΤϯδχΞͰ͋ΔͷͰ ͜ΕΒͷʹରͯ͋͠Δఔ·Ͱ ಠྗͰର߅͢Δ͜ͱ͕Ͱ͖Δ
ͨͱ͑Image::MagickΛ͏ use Image::Magick; $img = Image::Magick->new(); $img->Read("input.jpg"); $img->Resize( geometry =>
"400x400", ); ... $img->Write("output.jpg");
ͨͱ͑CSSͰ͏·͍͜ͱ߹ΘͤΔ .img { background-image: url("input.jpg"); /* style attributeͰࢦఆ͢Δͷ͕Ұൠత */ background-size:
cover; background-position: center center; width: 400px; height: 400px; }
ͨͱ͑ngx_small_lightΛ͏ server { listen 8000; server_name localhost; small_light on; small_light_pattern_define
square dw=400,dh=400,da=l,q=95,e=imagemagick,jpeghint=y; # http://localhost:8000/small_light(p=square)/input.jpg location ~ small_light[^/]*/(.+)$ { set $file $1; rewrite ^ /$file; } }
දࣔͰ͖ͯΔ͔ΒͱΓ͍͍͚͋͑ͣͲ͜ΕͰਖ਼͍͠ͷʁ ImageMagickʹresizeɺscaleͱthumbnail͕͋Δ͚Ͳ ͳΜ͔ಛఆͷϒϥβͰݟΔͱ৭͕มΘͬͯݟ͑Δ͚Ͳ ͕ࣗΊͨޙ୭͕ϝϯςͰ͖ΔΜͩΖ͏……
૿͑ଓ͚͍ͯ͘αʔϏε ͯ͢ͷWebαʔϏε͕ ը૾ॲཧΛ࣮/ӡ༻͢Δඞཁ͕͋Δͷ͔ʁ
ੲαʔόύʔπΛങ͍͚ͬͯͭͬͯͨ͘Ͳ……
ଵଦͰ͋ΔΤϯδχΞͷͨΊͷΫϥυը૾มαʔϏε
HTTP/S3ετϨʔδ ը૾มॲཧ ΦϦδφϧը૾Λऔಘ มޙΩϟογϡΛ৴ ΤϯυϢʔβ ίϯςϯπΩϟογϡ URLΛม͑Δ͚ͩͰը૾ม https://example.imageflux.jp/w=400,h=400/input.jpg ͍··Ͱ͍ͬͯͨ ετϨʔδΛͦͷ··͑Δ
ͭ·Γɺ͍͍ͩͨ small light as a service
ࣾͰར༻͍ͯͨ͠ը૾มγεςϜ͕ϕʔε ϐΫγϒ͕UGCը૾ϑΝΠϧͱઓ͖ͬͯͨྺ࢙ ࣾͰ͍͠B2BαʔϏε ͘͞ΒΠϯλʔωοτͱڞಉͰ։ൃɺӡ༻ ImageMagickΛ͍ͬͯͳ͍
LVS LB / DSR nginx HTTP front server ৴Ϋϥελ ཧαʔό
GRPC HTTP API Traffic Server HTTP front server Golang Thumbnailing server Golang Fetching server Golang Master server Scala Console / API
ͳͥGoͰॻ͍͍ͯΔͷ͔: - ܰྔεϨου(goroutine) - ඇಉظॲཧΛॎʹॻ͚Δʢωετ͠ͳ͍͍ͯ͘ʣ - γϯάϧόΠφϦ - CͷίʔυΛݺΔ
cgo package main // // int fortytwo() // { //
return 42; // } // import "C" import "fmt" func main() { fmt.Println(int(C.fortytwo())) // Output: 42 } ίϝϯτ෦ʹCͷίʔυΛهड़
cgo ίϝϯτ෦ʹCͷίʔυΛهड़ʢͪΐͬͱ͖ͪΘΔ͍ʣ Go͔ΒCͷܕΛ͑Δ - C.int - C.MyFunc
net/http libjpeg-turbo scale libpng CͷϥΠϒϥϦ GoͷHTTPαʔό࣮ GoͱCͷ͍͍ͱ͜ͲΓ
౦ژɺԬͷ྆ํʹ։ൃऀ/Ϛωʔδϟ͕͍·͢ appear.inͰ౦ژ-ԬΛ24࣌ؒଓ ͘͞Β౦ژɺϐΫγϒ౦ژɺ͘͞ΒେࡕɺϐΫγϒԬ ͰςϨΧϯ͢Δָ͍͠৬Ͱ͢ Tokyo Osaka Fukuoka
ImageFluxͰΤϯδχΞΛืू͍ͯ͠·͢ʂ Wantedlyɺฐࣾ࠾༻αΠτɺ࠙͘͠ձͰ HTTPϓϩΩγΛॻ͍ͨΓը૾มΛ࠷దԽͨ͠Γ ָ͍͠৬Ͱ͢ ౦ژͰԬͰಇ͚·͢ ϐΫγϒԬΦϑΟε ϐΫγϒ౦ژຊࣾ