YAPC::Fukuoka lunch session

YAPC::Fukuoka lunch session

YAPC::Fukuoka ランチスポンサーセッション
2017-07-01

124da56a613b15fa980427533e4e3839?s=128

Harukasan

July 01, 2017
Tweet

Transcript

  1. ଵଦͰ͋ΔΤϯδχΞͷͨΊͷΫϥ΢υը૾ม׵αʔϏε @harukasan / MICHII Shunsuke 2017-07-01 :"1$'VLVPLBϥϯνεϙϯαʔηογϣϯ

  2. )BSVLBTBOಓҪढ़հ
 ϐΫγϒ ג ϦʔυΤϯδχΞ *NBHF'MVYࣄۀ੹೚ऀ
 ෱ԬΦϑΟεͰ͸ͳ͘౦ژຊࣾۈ຿ ೥෱Ԭݝٱཹถࢢੜ·Ε
 ٱཹถߴઐˠ۝޻େ ൧௩ ˠஜ೾େӃˠϐΫγϒೖࣾ


    3VCZͱ(Pͱ͢͜͠4DBMBΛॻ͘ΠϯϑϥܥΤϯδχΞ
 ීஈ͸ࣇͷ෕
  3. None
  4. ૑࡞׆ಈ͕΋ͬͱָ͘͠ͳΔ৔ॴΛͭ͘Δ

  5. None
  6. ϥϯνηογϣϯ

  7. None
  8. ϖ Image ϖ Image ϖ Image ϖ Image ϖ Image

    ϖ Image
  9. ϨΠΞ΢τΛม͍͑ͨ
 ৽͍͠αΠζͷαϜωΠϧ͕΄͍͠ ৽͍͠σόΠεʹରԠ͍ͨ͠
 ͍··ͰͷαϜωΠϧͩͱখ͍͞ ͖Ε͍ʹݟ͑ΔΑ͏ʹ͍ͨ͠
 ը࣭Λམͱͣ͞ʹॖখ͍ͨ͠ දࣔ଎౓Λ͸΍͍ͨ͘͠
 WebPͰ഑৴͍ͨ͠

  10. զʑ͸ΤϯδχΞͰ͋ΔͷͰ ͜ΕΒͷ໰୊ʹରͯ͋͠Δఔ౓·Ͱ ಠྗͰର߅͢Δ͜ͱ͕Ͱ͖Δ

  11. ͨͱ͑͹Image::MagickΛ࢖͏ use Image::Magick; $img = Image::Magick->new(); $img->Read("input.jpg"); $img->Resize( geometry =>

    "400x400", ); ... $img->Write("output.jpg");
  12. ͨͱ͑͹CSSͰ͏·͍͜ͱ߹ΘͤΔ .img { background-image: url("input.jpg"); /* style attributeͰࢦఆ͢Δͷ͕Ұൠత */
 background-size:

    cover;
 background-position: center center;
 width: 400px;
 height: 400px; }
  13. ͨͱ͑͹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; } }
  14. දࣔͰ͖ͯΔ͔ΒͱΓ͍͍͚͋͑ͣͲ͜ΕͰਖ਼͍͠ͷʁ ImageMagickʹ͸resizeɺscaleͱthumbnail͕͋Δ͚Ͳ ͳΜ͔ಛఆͷϒϥ΢βͰݟΔͱ৭͕มΘͬͯݟ͑Δ͚Ͳ ࣗ෼͕΍Ίͨޙ୭͕ϝϯςͰ͖ΔΜͩΖ͏……

  15. ૿͑ଓ͚͍ͯ͘αʔϏε ͢΂ͯͷWebαʔϏε͕ ը૾ॲཧΛ࣮૷/ӡ༻͢Δඞཁ͕͋Δͷ͔ʁ

  16. ੲ͸αʔό΋ύʔπΛങ͍͚ͬͯͭͬͯͨ͘Ͳ……

  17. ଵଦͰ͋ΔΤϯδχΞͷͨΊͷΫϥ΢υը૾ม׵αʔϏε

  18. HTTP/S3ετϨʔδ ը૾ม׵ॲཧ ΦϦδφϧը૾Λऔಘ ม׵ޙΩϟογϡΛ഑৴ ΤϯυϢʔβ ίϯςϯπΩϟογϡ URLΛม͑Δ͚ͩͰը૾ม׵ https://example.imageflux.jp/w=400,h=400/input.jpg ͍··Ͱ࢖͍ͬͯͨ
 ετϨʔδΛͦͷ··࢖͑Δ

    ͭ·Γɺ͍͍ͩͨ
 small light as a service
  19. ࣾ಺Ͱར༻͍ͯͨ͠ը૾ม׵γεςϜ͕ϕʔε ϐΫγϒ͕UGCը૾ϑΝΠϧͱઓ͖ͬͯͨྺ࢙ ࣾ಺Ͱ͸௝͍͠B2BαʔϏε ͘͞ΒΠϯλʔωοτͱڞಉͰ։ൃɺӡ༻ ImageMagickΛ࢖͍ͬͯͳ͍

  20. 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
  21. ͳͥGoͰॻ͍͍ͯΔͷ͔: - ܰྔεϨου(goroutine) - ඇಉظॲཧΛॎʹॻ͚Δʢωετ͠ͳ͍͍ͯ͘ʣ - γϯάϧόΠφϦ - CͷίʔυΛݺ΂Δ

  22. cgo package main // // int fortytwo() // { //

    return 42; // } // import "C" import "fmt" func main() { fmt.Println(int(C.fortytwo())) // Output: 42 } ίϝϯτ෦ʹCͷίʔυΛهड़
  23. cgo ίϝϯτ෦ʹCͷίʔυΛهड़ʢͪΐͬͱ͖΋ͪΘΔ͍ʣ Go͔ΒCͷܕΛ࢖͑Δ - C.int - C.MyFunc

  24. net/http libjpeg-turbo scale libpng CͷϥΠϒϥϦ GoͷHTTPαʔό࣮૷ GoͱCͷ͍͍ͱ͜ͲΓ

  25. ౦ژɺ෱Ԭͷ྆ํʹ։ൃऀ/Ϛωʔδϟ͕͍·͢ appear.inͰ౦ژ-෱ԬΛ24࣌ؒ઀ଓ ͘͞Β౦ژɺϐΫγϒ౦ژɺ͘͞ΒେࡕɺϐΫγϒ෱Ԭ ͰςϨΧϯ͢Δָ͍͠৬৔Ͱ͢ Tokyo Osaka Fukuoka

  26. ImageFluxͰ͸ΤϯδχΞΛืू͍ͯ͠·͢ʂ Wantedlyɺฐࣾ࠾༻αΠτɺ΋͘͠͸࠙਌ձͰ HTTPϓϩΩγΛॻ͍ͨΓը૾ม׵Λ࠷దԽͨ͠Γ
 ָ͍͠৬৔Ͱ͢ ౦ژͰ΋෱ԬͰ΋ಇ͚·͢ ϐΫγϒ෱ԬΦϑΟε ϐΫγϒ౦ژຊࣾ