5 ms·
TuneMyGC: Optimal MRI Ruby 2.1+ Garbage Collection
- michaelmior 12y agoIt would be nice to have some idea of how these optimized settings are determined. It's also not clear to me if this is intended to work for any Ruby code, or just rails apps. In any case, this seems pretty cool as I think many (myself included) don't bother to even try to tune GC. EDIT: I'd also like to see a privacy policy that talks about what data they collect and how it's used.
- pencilcheck 12y agoLooks like what they are collecting is in this array: [TuneMyGc.walltime, TuneMyGc.peak_rss, TuneMyGc.current_rss, stage, GC.stat.values_at(*stat_keys), GC.latest_gc_info, meta] In this file: https://github.com/bear-metal/tunemygc/blob/70a02b9dd252c6f5d6909b05cf581bb72f8b7b3a/lib/tunemygc/snapshotter.rb https://github.com/bear-metal/tunemygc/blob/70a02b9dd252c6f5... Or in their protocol.md: https://github.com/bear-metal/tunemygc/blob/master/doc/protocol.md https://github.com/bear-metal/tunemygc/blob/master/doc/proto...
- methodmissing 12y agoYes, what we wanted to communicate was that nothing proprietary to your app or code gets sent on the wire. Just a few numbers about memory usage and heap status the tuner analyses.
- methodmissing 12y agoHi Michael, it originally started with a focus on Rails only, but at the moment we also support test frameworks, pure Ruby (requires some minor work on the user end), ActiveJob and Sinatra soon. We'll rework the docs and landing page to reflect this. Thanks for your feedback.
- c3RlcGhlbnI_ 12y agoTheir github has all of the same info but also answers some very important questions about the service https://github.com/bear-metal/tunemygc? https://github.com/bear-metal/tunemygc?. Namely they tell you that it sets a bunch of environment variables and they tell you what information they collect. What I want to know is why this needs to get recommendations from a web service. Do they have to collect a bunch of data to learn good recommendations for different situations? Isn't it much simpler to have an algorithm optimizing the parameters locally, or does that take too long to learn good values?
- pmontra 12y agoMaybe the algorithm can make better recommendations using data from multiple web apps but I suspect that it could be a commercial choice leading to a paid service (think about NewRelic). It's completely legit, nevertheless I'll prefer to keep my usage data inside my own box.
- methodmissing 12y agoYes, there's the ability to aggregate information from eg. several Unicorn worker instances on the same box for the same app and distributed too, but it's not exposed through the tuner, yet. That's a more accurate representation of how the GC behaves across a stack. Nothing's set in stone, we're still exploring and engaging for feedback.
- kirillzubovsky 12y agoWhat kind of improvement are we looking at by tuning GC? Is there a recommended app size /setup after which it actually makes sense to bother with GC? This all comes to mind because any extra dependencies in my app are an ongoing pain in the ass; got plenty of those already. If this could give me a 20% speed boost - hell yeah, I'll try that. If it's a 0.4% ... nope. From the first glance, it seems easier to do nothing, than to try something that may work. just my 2c
- pmontra 12y agoFrom their diagram about Discourse it seems it could be a 30% boost.
- deleted 12y ago[deleted]
- foz 12y agoIt makes me think that there's something wrong with the Ruby VM when someone has to offer a service like this. The Ruby community should expect great performance out-of-the-box, and the VM should tune itself, automatically.
- RussianCow 12y agoVM performance is hard. It took years and years and years for the HotSpot VM to get as fast as it is now. Give it time.
- riffraff 12y agoI might be out of date but every time I worked with the JVM I ended up with a lot of command line params to tune the GC and other things. VMs can tune themselves up to a point but there is always need to give them some precise bounds/goals, methinks.
- Twirrim 12y agoAs good as Hotspot is, it still needs tuning. The simple truth is there isn't a "one size fits all" solution for GC, it really depends on what you're doing and how the performance characteristics fit in to it.
- pjmlp 12y agoIt is no different from the endless list of command line options for compilers.
- Gurkenmaster 12y agoFor the curious enter the following into your terminal >java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal -version It will list about 700 options.
- foz 12y agoTo clarify my down-voted comment a bit: I think part of the problem is that GC tuning has become kind of a black art. It's hard to find documentation and advice to get good results. Tuning services like MySQL, Apache, Nginx is pretty straightforward; there's documentation, guides, tools and plenty of clear ways to monitor it. In my search for Ruby VM tuning, I've found only very technical guides or blog posts that involve a lot of steps, and are not focused on real-world experience. That being said, I'd like to try this service, the guys behind it seem to really know what they are doing.
- ernestsim 12y agoAfter syncing snapshots im getting (error: hostname "tunemygc.com" does not match the server certificate) even after running certified-update
- methodmissing 12y agoThanks for flagging, we're looking into it.
- psychometry 12y agoIf I want to tune a Rails app on Heroku, would I need the add-on that's in alpha testing or will the standalone gem work?