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
3k
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
460
20240401 新卒研修 - ピクシブにおける技術領域
harukasan
PRO
1
770
ピクシブのコンテンツ配信基盤技術 / pixiv TECH SALON
harukasan
PRO
5
5.5k
Goにおける画像ファイル処理 / golang.tokyo #19
harukasan
PRO
7
6.6k
WebRTC動画をトランスコードする / Transcoding video streams from WebRTC
harukasan
PRO
5
1.5k
ImageFluxを支えるリモート開発 / 20171202
harukasan
PRO
2
1.8k
YAPC::Fukuoka 前夜祭LT / Yet Another Pawoo Commit logs
harukasan
PRO
0
3k
マストドン会議: Pawoo / Mastodon Kaigi2
harukasan
PRO
2
480
大規模Mastodonインスタンスを運用するコツ / Inside Pawoo Mastodon infrastructure
harukasan
PRO
0
3.3k
Other Decks in Technology
See All in Technology
AI・LLM事業部のSREとタスクの自動運転
shinyorke
PRO
0
300
RAGの基礎から実践運用まで:AWS BedrockとLangfuseで実現する構築・監視・評価
sonoda_mj
0
440
Redefine_Possible
upsider_tech
0
330
Riverpod & Riverpod Generatorを利用して状態管理部分の処理を書き換えてみる簡単な事例紹介
fumiyasac0921
0
110
新卒エンジニア研修の試行錯誤と工夫/nikkei-tech-talk-31
nishiuma
0
200
Restarting_SRE_Road_to_SRENext_.pdf
_awache
0
170
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
3
1.4k
OPENLOGI Company Profile for engineer
hr01
1
22k
SSH公開鍵認証による接続 / Connecting with SSH Public Key Authentication
kaityo256
PRO
2
230
Amazon GuardDuty Malware Protection for Amazon S3を使おう
ryder472
2
110
マルチアカウント管理で必須!AWS Organizationsの機能とユースケース解説
nrinetcom
PRO
1
100
Symfony in 2025: Scaling to 0
fabpot
2
220
Featured
See All Featured
Facilitating Awesome Meetings
lara
53
6.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
29
2k
What's in a price? How to price your products and services
michaelherold
245
12k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
BBQ
matthewcrist
88
9.5k
Practical Orchestrator
shlominoach
186
10k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
Speed Design
sergeychernyshev
28
870
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Unsuck your backbone
ammeep
670
57k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
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ϓϩΩγΛॻ͍ͨΓը૾มΛ࠷దԽͨ͠Γ ָ͍͠৬Ͱ͢ ౦ژͰԬͰಇ͚·͢ ϐΫγϒԬΦϑΟε ϐΫγϒ౦ژຊࣾ