4 ms·
The best thing to do is profile your app's performance, make a change and observe the results. It will help you make sure that your effort and money are actuall
by lukeck 11y ago
The best thing to do is profile your app's performance, make a change and observe the results. It will help you make sure that your effort and money are actually improving things. New Relic has been great for this, and I've also heard good things about Data Dog. Run your app for a while with one of those in place, observe where the bottlenecks are, then come up with experiments to test whether you can improve performance.
If it's a Rails app, two things spring to mind as first things to try once you have profiling in place:
- lower the number of web server workers and/or threads (depending on what you're using)
- Ruby 2.1's garbage collector is really not well suited to web apps because it will often promote objects from a single request to the long-lived generation, even though they will not be needed again. Going from 2.0 to 2.1 nearly doubled the memory usage of one of our apps. 2.2 is doing much better.
You might also want to see if you can offload any processing of tasks that can be queued using something like Sidekick or Resque.
There's a bunch of other things you could do but you really need to work out why your app isn't performing as you'd like first.
- arthurcolle 11y agoI'm using Rubinius, the C++ implementation of Ruby in conjunction with Puma. (http://rubini.us http://rubini.us) I'll definitely check out Data Dog and New Relic, thanks for the tip
- arthurcolle 11y agoRubinius was the culprit! 250MB alone! WTF!