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

サービスに寄り添うログ基盤/pepabo_log_infrastructure_bigfoot

 サービスに寄り添うログ基盤/pepabo_log_infrastructure_bigfoot

サービスに寄り添うログ基盤 - ログ収集のその先に -
はてな・ペパボ技術大会〜インフラ技術基盤〜@京都
http://hatena.connpass.com/event/33521/

monochromegane

July 02, 2016
Tweet

More Decks by monochromegane

Other Decks in Programming

Transcript

  1. #JHGPPU IDFA/GAID UID rack-bigfoot Service Request Activity log Services DB

    Attribute Big Cube Cube https://icons8.com BI Recommendation Bandit algorithm Re-marketing Feedback Name identification Cookie Sync
  2. )JWF2- w5SFBTVSF%BUB্ͷߦಈϩάΛ42-ϥΠΫʹѻ͏ wIUUQIJWFBQBDIFPSH wIUUQTEPDTUSFBTVSFEBUBDPNBSUJDMFTIJWF SELECT TD_TIME_FORMAT(time, 'yyyy-MM-dd HH:mm:ss', 'JST') AS

    timestamp, response_time, request_method, path_info FROM activity WHERE TD_TIME_RANGE(time, '2016-07-01 10:00:00', '2016-07-01 12:00:00', 'JST');
  3. 1FOEVMVN schedule 'test-scheduled-job' do database 'db_name' query 'select time from

    access;' retry_limit 0 priority :normal cron '30 0 * * *' timezone 'Asia/Tokyo' delay 0 result_url 'td://@/db_name/table_name' end Schedfile Apply $ pendulum --apikey='...' -a --dry-run $ pendulum --apikey='...' -a
  4. ଐੑ৘ใ wߦಈϩάͱଐੑ৘ใΛ૊Έ߹ΘͤΔ͜ͱͰ෼ੳ࣌ͷ෯͕޿͕Δ Attribute Master 1,000 records each Sidekiq workers def

    perform(*args) User.order(:id).select(:id).find_in_batches do |users| UserAttributesUploadJob.perform_later(users.first.id, users.last.id) end end Activity Join HiveQL No temporary file
  5. Ϩίϝϯυ.BUSJY'BDUPSJ[BUJPO R’ui = μ + Bu + Bi + Pu

    TQi minP,Q,B Σ (Rui - R’ui )2 + λ(||Bu ||2 + ||Bi ||2 + ||Pu ||2 + ||Qi ||2) ༧ଌ ֶश (u,i)∈R ਖ਼ଇԽ߲ ޡࠩ ฏۉ όΠΞε
  6. Ϩίϝϯυ.BUSJY'BDUPSJ[BUJPO SELECT idx, array_avg(u_rank) as Pu, array_avg(i_rank) as Qi, avg(u_bias)

    as Bu, avg(i_bias) as Bi, min(mu) as mu FROM ( SELECT train_mf_sgd(account_id, creator_id, rating, '-factor 20 -iter 50 -update_mu') AS (idx, u_rank, i_rank, u_bias, i_bias, mu) FROM training ) t GROUP BY idx;