Skip to content

Archives

Pitchfork

  • Pitchfork

    An amazing journey through Ruby heap memory optimization, from one of the experts at Shopify, who are heavy users of Rails. Using cleverly-timed fork(2) usage, it’s possible to optimize memory usage in a Rails app and discard a lot of performance/heap overhead caused by lazy loading and poorly-timed in-memory caching.

    This very much reminds me of optimising similar issues in Perl-land, back in the day — and really helps me appreciate how easy the modern JVM world has it, in comparison. There’s a lot of complaints to be made about the complexity of optimising JVM garbage collection settings, but this kind of problem is malleable there without a fundamental architectural rewrite like this approach.

    Tags: ruby performance optimisation optimization heap memory fork forking http services servers monolith rails gc