Upgrade to Pro — share decks privately, control downloads, hide ads and more …

prevs.io開発の裏側とコンテナ仮想化時代のAPI運用

 prevs.io開発の裏側とコンテナ仮想化時代のAPI運用

API Meetup Tokyo #7での発表資料です

Naoki Ainoya

March 27, 2015
Tweet

More Decks by Naoki Ainoya

Other Decks in Programming

Transcript

  1. Marketer Engineer ͜ͷલ΍ͬͯ͘ΕͨվળҊ"ͷ ը໘ɼͪΐͬͱݟͤͯ͘Εͳ͍ʁ ෼͔Γ·ͨ͠ʙɽվળҊ"Λ εςʔδϯάʹσϓϩΠ͠·ͨ͠ ྃղʔ ͋ͱͰݟͱ͘Ͷɽ ೔ޙ 

    ͋Εʁ͜ͷը໘"Ҋͷ͡Όͳ͘ͳ ͍ʁͲ͏ͳͬͯΜͷʁ εςʔδϯάผͷҊ݅Ͱ࢖͍· ͢ʔɽ ͋ɼ͍͢·ͤΜଞͷ֬ೝͰ εςʔδϯά࢖ͬͯ·ͨ͠ʜɽ ૣ͘νΣοΫ͍ͨ͠Μ͚ͩͲʂ ͋ɼࠓσϓϩΠ͠ͳ͓͠·ͨ͠ʂ ʢࣗ෼Ͱ΍Ε͹͍͍ͷʹ ֬ೝͰ͖·ͨ͠ʔɽ ͋ͱվળҊ#΋΍ͬͺΓؾʹͳΔ ͔ΒεςʔδϯάͰݟͤͯ͞ ͋ɼࠓଞͷ2"Ͱεςʔδϯά ࢖ͬͯͯͰ͖ͳ͍Ͱ͢ʜɽ ͏Δ͍͞ૣ͘΍Εʂ ୀ৬ͩ 8FC։ൃ͋Δ͋Δ
  2. High-Scale Async Task Processing   #  Worker  code  can  be

     anything  you  want.     puts  "Payload:  #{params}"     puts  "Simulating  hard  work  for  5  seconds..."     5.times  do  |i|     puts  "Sleep  #{i}..."     sleep  1     end     puts  "Completed  at  #{Time.now}"     #  Create  hello.worker  file     #  define  the  runtime  language     runtime  'ruby'     #  exec  is  the  file  that  will  be  executed:     exec  'hello_worker.rb'     #  Upload  Worker     $  iron_worker  upload  hello     #  Queue  Workers     require  "iron_worker_ng"     client  =  IronWorkerNG::Client.new     #  launch  100  tasks  in  parallel     100.times  do     client.tasks.create("hello",  foo:  "bar")     end     #  Run  task  once  per  hour  at  high  priority     $  iron_worker  schedule  hello  \                        —start-­‐at  "2013-­‐01-­‐01T00:00:00-­‐04:00"  \              -­‐-­‐run-­‐every  3600  -­‐-­‐priority  2