Node Apps Performance Tuning

Node Apps Performance Tuning

YAPC::ASIA Hachioji 2016 mid in Shinagawa

6de30acfd736745120a3d6457dc6d45c?s=128

Daiki Matsui

July 02, 2016
Tweet

Transcript

  1. Node Apps Performance Tuning @ikemonn

  2. @ikemonn ΠϯϑϥΤϯδχΞ

  3. ໨࣍ 1. ߏ੒ 2. ଌఆ 3. νϡʔχϯά 4. ·ͱΊ

  4. ໨࣍ 1. ߏ੒ 2. ଌఆ 3. νϡʔχϯά 4. ·ͱΊ

  5. v4.4.3 v3.0.8

  6. ໨࣍ 1. ߏ੒ 2. ଌఆ 3. νϡʔχϯά 4. ·ͱΊ

  7. response timeΛ֤ॲཧͰଌఆ 1. ࣗ෼Ͱॻ͍ͨίʔυͷܭଌ

  8. var dogstatsd = require('libs-dogstatsd') const stats = dogstatsd.start(); // some

    method stats.tick('test'); libs-dogstatsd
  9. None
  10. CPU? or Memory? 2. ࣗ෼Ͱॻ͍ͨίʔυҎ֎ͷܭଌ

  11. node-inspector/v8-profiler thlorenz/traceviewify

  12. x࣠: CPU time y࣠: stack trace

  13. ԣ෯͕޿͘(CPU timeΛফඅ͍ͯͯ͠) ΪβΪβͰͳ͍(ಛఆͷॲཧ͕ϘτϧωοΫ) ΋ͷΛ୳͢

  14. virtual

  15. • Mongoose Document • vogels • console.error

  16. ໨࣍ 1. ߏ੒ 2. ଌఆ 3. νϡʔχϯά 4. ·ͱΊ

  17. • Mongoose Document • lean()Λ࢖͏ • vogels • aws-sdkΛ࢖͏ •

    console.error • stackΛग़͢৔ॴΛߜΔ
  18. 25%վળʂ

  19. ໨࣍ 1. ߏ੒ 2. ଌఆ 3. νϡʔχϯά 4. ·ͱΊ

  20. None
  21. profileΛऔΔ͜ͱͰ ࣗ෼ͷίʔυҎ֎ͷ ϘτϧωοΫʹؾ͚ͮͨʂ

  22. We are hiring! https://www.wantedly.com/projects/54721