23

weekly learning

Posted by ilake on January 28, 2017

“strive 1/21 ~ 1/28”

Use

Read

  • [capistrano] Capistrano 3 Upgrade Guide

  • [rails] Rails Connection Leak

  • [web] 為什麼瀏覽器 user-agent string 總是包含 Mozilla/5.0 ?

  • [web] 如何切割 Microservices

    1. 這部份程式的行為是相對獨立的
    2. 即將快速發展
    3. scope 大 + legacy
  • [rails memory] Memory constantly increasing in Rails app

    1. sessions related?
    2. count_objects to display all the objets currently used
    3. symbols are keep in memory until your restart ruby. Symbol.all_symbols.size
  • [rails memory] 不是内存泄漏,而是Bloat

    • What Is Bloat? you are loading in too much. Too much what, you ask? Why it’s too much ActiveRecord!
    • Detecting Bloat => grep resource /var/log/syslog, The problem is when you have bloat, you start seeing them skyrocket past the memory limits, sometimes multiple times an hour:
    • Root Cause
      1. Model.find(:all)
      2. :includes are Including Too Much
      3. :includes on a has_many
      4. @model_instance.relationship
      5. Filtering Records with Ruby Instead of SQL
      6. Evil Callbacks in the Model
      7. Named scopes, default scopes, and has_many relationships that specify :include Where Inappropriate
      8. Use :select When You Must Instantiate Large Quantities of Records
      9. Overfed Feeds
      10. Monster Migrations

Book

Video

  • [邏輯思維] 184 怎么样成为一个高手

    • 筆記 看到文章 影片 無論如何 都要至少寫下一句自己的心得
  • [RubyConf 2016] - From no OSS experience to the core team in 15 minutes a day by André Arko

    1. start from read all the issues
    2. try to answer questions
    3. help with issues
    4. reproduce bugs
    5. writing patches
    6. improving everything
  • [ruby china 2016] 如何在 Rails 应用里面寻找内存泄漏

    • how to detect:
      • passenger-memory-stats
      • passenger-status
      • top && htop
      • cat /proc/pid/status & cat/proc/[pid]/mem
    • Tgid(Thread Group ID) is real process id, get_pid
    • Application:
      • New Relic
      • SKYLIGHT
      • Scout APM
      • ONE APM
    • how to resolve
      • doorkeeper
        • passenger_killer: killed after finished N processes
        • oom_killer: killed process when exceed N processes, passenger auto restart
        • oob: auto gc after finished N processes
      • tools
        • derailed_benchmarks
        • memory_profiler
        • stackprof
        • rbkit
        • rbkit-client
        • oink
        • memorylogic
  • [ruby china 2016] Rubyists 可以从 Elixir 学到什么

    • based on Erlang
    • ships with great tools inspired by Ruby
    • Ruby-like syntex
    • functional way
    • microservice

Learn