Takeaways

When optimizing your application, look beyond the code in your search for performance problems. Sometimes an unoptimized application running on a properly configured software stack will perform better than the thoroughly optimized one in a poorly configured stack.

This chapter has expored several items you need to think about when deploying your Ruby application:

  • Restart your long-running processes when they grow too large in memory. A freshly started application runs faster because the GC has fewer objects to collect.

  • Run heavy tasks in an isolated forked environment. This way the forked process will give back to the operating system all the memory allocated during its execution.

  • Do out-of-band garbage collection if you use ...

Get Ruby Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.