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

rails + serverengineで
お手軽daemon

rails + serverengineで
お手軽daemon

threetreeslight

October 02, 2015
Tweet

More Decks by threetreeslight

Other Decks in Technology

Transcript

  1. ͲΜͳ͜ͱʹ࢖ͬͯΔͷʁ serverengine sidekiq AWS lambda w ಈըͷม׵ w ղੳσʔλΩϟογϡ w

    ఆظܾࡁ w QVTI༧໿ͷ؂ࢹ w *O"QQର৅ऀͷߋ৽ FUDʜ w ϝʔϧΛૹΔ w ղੳσʔλΛૹΔ w ഑৴σʔλͷ࡞੒ FUDʜ w 1VTIૹΔ FUDʜ
  2. ͲΜͳ͜ͱʹ࢖ͬͯΔͷʁ serverengine sidekiq AWS lambda w ಈըͷม׵ w ղੳσʔλΩϟογϡ w

    ఆظܾࡁ w QVTI༧໿ͷ؂ࢹ w *O"QQର৅ऀͷߋ৽ FUDʜ w ϝʔϧΛૹΔ w ղੳσʔλΛૹΔ w ഑৴σʔλͷ࡞੒ FUDʜ w 1VTIૹΔ FUDʜ
  3. Exception def cycle invoke end 
 def invoke( *arguments )

    execute( *arguments ) rescue => error report_exception(error) end def execute( *arguments ) raise NotImplementedError end def report_exception(error) # logging, rollbar, newrelic ... end • handle͠ͳ͕Βࢭ·Βͣલਐ
  4. Avoid memory leak • ʢrubyͷઃఆͰղܾͰ͖Δͱࢥ͏͚Ͳʣfragmentation͕ ཷ·ΔͷͰఆظతʹڧ੍GC class worker … def

    run begin GC.stop cycle ensure GC.start end rescue Exception => error report_exception error end … end
  5. Ͱͨ͠ serverengine sidekiq AWS lambda w ಈըͷม׵ w ղੳσʔλΩϟογϡ w

    ఆظܾࡁ w QVTI༧໿ͷ؂ࢹ w *O"QQͷλʔήοτߋ ৽ w ಈըͷม׵ w ϝʔϧΛૹΔ w ղੳσʔλΛૹΔ w ഑৴σʔλͷ࡞੒ FUDʜ w 1VTIૹΔ FUDʜ