Guest User

Untitled

a guest
Jul 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. # Rails, bad configuration
  2.  
  3. We thought it was memory leak, but it was bad configuration
  4.  
  5. configuration that didnt work before:
  6.  
  7. 1. puma (RAILS_MAX_THREADS: 8, WEB_CONCURRENCY: 8)
  8. 1. db pool - 10
  9. 1. memory cache
  10.  
  11. worked:
  12.  
  13. 1. puma (RAILS_MAX_THREADS: 2, WEB_CONCURRENCY: 8)
  14. 1. db pool - 100
  15. 1. redis + elasticache
  16.  
  17. Conclusion: ???
  18.  
  19. # Rails, very big publication content because of inlined base64 images
  20.  
  21. Someone created publication with inlined image `<img src="data:base64....">` and server crashed
  22. because publication content were parsed for `[shortcodes]`
  23.  
  24. We thought it was memory leak, but it was not.
  25.  
  26. We uploaded such images and problem disappeared.
  27.  
  28. Lessons learned:
  29. - `bundle exec derailed exec perf:mem_over_time` doesnt show right stats without `GC.start` on each request
  30. - memory graph should be as logaripghm, if its increasing linearly - bad, if after 200k req its still increasing a little - fine
  31.  
  32. How it could be prevented:
  33. - check maybe only some request cause crash
Add Comment
Please, Sign In to add comment