15 ms·
Fullstaq Ruby: Ruby, optimized for production
- rashkov 5y agoThis is neat. There’s a good FAQ explaining, for instance, why they don’t upstream these changes to ruby core. https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/blob/main/README.md#faq https://github.com/fullstaq-labs/fullstaq-ruby-server-editio...
- carl_dr 5y agoTo clarify for casual readers who might not dig into that, it’s not that Fullstaq is refusing to contribute or that they are commercial. They say : “There will be no paid version. Fullstaq Ruby is fully open source. It is also intended to be a community project where anyone can contribute. There are no monetization plans.” Thought I would mention that in case the parent’s comment implied something different. It’s more that the core Ruby team are reluctant to.
- rashkov 5y agoYes thanks for clarifying
- mberning 5y agoCool project. Not a big fan of the name. Kind of hard to sell to a sourcing team. If they called it “Enterprise Ruby” or something like that the conversation is going to be much easier.
- sudhirj 5y agoPhusion Passenger (same team) has lots of enterprise offerings with very entierprisey names and prices.
- pmontra 5y agoName taken, see http://www.rubyenterpriseedition.com/ http://www.rubyenterpriseedition.com/
- jmcgough 5y agoamazing, this hasn't been updated since ruby 1.8
- FooBarWidget 5y agoAuthor of both projects here. Yes Ruby Enterprise Edition eventually became obsolete because most features found their way back to MRI. But that took a few years. During those years, Ruby Enterprise Edition made a lot of users happy.
- atonse 5y agoWe used REE for a while and it was excellent. Thank you for your work on it!
- samgranieri 5y agocan confirm.
- bdcravens 5y agoActually from the same developer. This project is actually under a different company; it's not clear why.
- jbverschoor 5y agoIf there are three solutions, you will have to choose which one. I think it's an easier sell to the enterprise, eventhough all three projects are by the same person (passenger, ree, fullstaq)
- bdcravens 5y agoFullstaq is a company. https://fullstaq.com/ https://fullstaq.com/
- sudhirj 5y agoFor those wondering why on earth this isn’t simply a contribution to Ruby, the FAQ has a really nice explanation - tldr is that this is a variant optimised for the very specific context of Linux, x86/64, server environments, with pre compiled and packaged binaries, with special memory allocators (jemalloc). These changes are specific to this context and are unlikely to be accepted into the more generalised Ruby core. Same team as Phusion Passenger, so excellent background.
- joelbluminator 5y agoI'm not really buying the FAQ explanation, idk this feels too good to be true. Would have loved to see some core team discussion on this if there was one.
- FooBarWidget 5y agoAuthor of Fullstaq Ruby here. There have been discussions. Discussions on jemalloc integration preceded Fullstaq Ruby for years. The bug tracker issue on the malloc_trim patch went stale. All this can be found on the issue tracker. I also spoke to Matz during EuRuKo 2019. And this is the impression I got.
- joelbluminator 5y agoAre you referring to this one? https://bugs.ruby-lang.org/issues/15667 https://bugs.ruby-lang.org/issues/15667 P.S did Discourse adopt this approach ? Also found a discussion on jemalloc https://bugs.ruby-lang.org/issues/14718 https://bugs.ruby-lang.org/issues/14718
- FooBarWidget 5y agoYes
- deleted 5y ago[deleted]
- actually_a_dog 5y agoI think this is interesting, but I'm wondering why there isn't a corresponding project for Python. It seems like people using Python could derive the exact same benefits, so, why doesn't the Python version exist of this project?
- karlding 5y ago> I'm wondering why there isn't a corresponding project for Python. But there are various projects for Python. For example, there's Pyston [0] which was started by Dropbox. Or Cinder [1] which was started by Facebook. Or PyPy [2]. [0] https://github.com/pyston/pyston https://github.com/pyston/pyston [1] https://github.com/facebookincubator/cinder https://github.com/facebookincubator/cinder [2] https://www.pypy.org/ https://www.pypy.org/
- joelbluminator 5y agoStill, adoption of these solutions seems low (PyPy seems to be a JIT as well is it really a corresponding solution?). If it magically reduces memory by as much as 30%-50% why isn't adoption higher? In other words what are the drawbacks of doing this, there must be cons.
- FooBarWidget 5y agoAuthor of Fullstaq Ruby here. From what I understand by talking to people, the reasons why Fullstaq Ruby doesn't have wider adoption are as follows: It's not a project officially blessed by Ruby core. Upstream Ruby is actually "good enough" for most. Most people don't feel the pain enough to try something which appears as unofficial. Perhaps their thinking are similar to yours: I'm hesitant because not everbody else is already using this. I want to make this an official project. But before I do, I want to make sure that the project is sufficiently ready: healthy, democratized, not reliant on myself: https://www.joyfulbikeshedding.com/blog/2020-05-15-why-fullstaq-ruby.html https://www.joyfulbikeshedding.com/blog/2020-05-15-why-fulls... I am also not marketing this as hard as I should. I lack free time. Another reason is because of the beta label. The only reason why the label is there is because I have a specific, ambitious vision on how "final" should look like (i.e. more features), not because it's unstable. Feedback from users regarding stability has been very good so far. I might be shooting myself in the foot marketing-wise by not removing the beta label earlier, but I'd rather do a good job than to hurry.
- rapsey 5y agoTime spent on dealing with optimisations is un under counted productivity sink of using languages like Ruby/Python.
- joelbluminator 5y agoThank you wise one for showing us the light.
- stanislavb 5y agoHas anyone installed fullstaq ruby with ASDF?
- FooBarWidget 5y agoAnyone who wants asdf support, vote for it here: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/discussions/76 https://github.com/fullstaq-labs/fullstaq-ruby-server-editio...
- sidcool 5y agoWhen I read fully open source, bells ring in my mind. I adopted Cypress. It advertised open source and community ethos. But when delved deep, it many basic features that were paid. They never advertised it well in documentation. Once bitten, twice shy
- stepbeek 5y agoWhat features are you missing? I’ve never paid for cypress purely because it had what I wanted out of the box. Now I’m wondering if I’ve missed something.
- sidcool 5y agoMainly parallel tests run. They have very limited support for parallel tests in community version. We need to buy the Cypress dashboard license
- stepbeek 5y agoThat’s fair. We built our own little parallel test runner to handle that runs each file in a different process but I would have paid if the official version supported parallel test runs on a single host.
- FooBarWidget 5y agoAuthor of Fullstaq Ruby here. There are absolutely no paid features, nor plans to monetize. There are even enough reasons to not monetize. See the FAQ: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/blob/main/README.md#will-fullstaq-ruby-become-paid-in-the-future https://github.com/fullstaq-labs/fullstaq-ruby-server-editio... And the project vision, which is community-based: https://www.joyfulbikeshedding.com/blog/2020-05-15-why-fullstaq-ruby.html https://www.joyfulbikeshedding.com/blog/2020-05-15-why-fulls...
- faebi 5y agoDo you have any plans to support ruby-install and therefore chruby?
- FooBarWidget 5y agoNo. Only rbenv. Unless there's a lot of user request.
- jbverschoor 5y agoI recently switched to asdf. Big time rbenv user, then added nodenv. I also needed multiple yarn versions. As asdf is based off / inspired by rbenv, it was an easy change.
- busterarm 5y agoI'm using asdf for everything I can. Even using it in CI/CD. Wonderful tool.
- FooBarWidget 5y agoUpdate: if you want asdf support, vote for it here: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/discussions/76 https://github.com/fullstaq-labs/fullstaq-ruby-server-editio...
- jrochkind1 5y agoIt's possible you can already easily use with chruby by just pointing chruby at it? I haven't tried, I am interested if anyone wants to report back! https://github.com/postmodern/chruby#rubies-1 https://github.com/postmodern/chruby#rubies-1 (You don't need to use ruby-install with chruby, you can use whatever method of installing rubies you want. The chruby README even includes instructions for `ruby-build`. But normally whatever method you use, you install to `/opt/rubies` or `~/.rubies` which is where chruby will look. But fullstaq ruby insists on installing to it's own locations. But possibly chruby will be fine with that if you just tell it where that is... but you might need to do it for each ruby you install, which woudl be annoying. You could probably write a little bash shim which just checked the fullstaq install location for which rubies it had, and then just added them each individually?)
- augstein 5y agoWould be a perfect fit, if this was available on Heroku. Memory bloat is a real problem, even for mid-size Rails apps. But it might not be in their interest, if customers are suddenly able to downgrade to cheaper Dynos with less memory, so we‘ll see.
- zrail 5y agoYou can run whatever you want in Heroku. Fork the official Ruby buildoack and teach it to install fullstaq, it's pretty easy to work on.
- sealjam 5y agoIt does say there’s a heroku edition “coming soon”
- wlll 5y agoYou can already use jemalloc on Heroku, it's really simple, so this comment is about releasing memory back to the OS, the other headline feature of Fullstaq. > Memory bloat is a real problem, even for mid-size Rails apps. Yes, but the solution isn't releasing the memory back to the OS, that's just papering over the cracks. If you're running (say) 10 Rails processes on a machine with 10 GB RAM, and particular request paths/background jobs whatever pushes the process size to 2 GB RAM size, you can release the memory back to the OS after you're done, but you still have the underlying problem which is the process gets to that size in the first place, and if all the processes hit 2GB at once, now you're 10 GB in debt, either in swap, or OOM errors. The solution you should be looking for is installing something like Scout (or NewRelic, but IMO Scout is better for memory stuff), looking to see what is bloating the processes, and in 99% of the time fixing it using some the Rails' batch find methods (seriously, it's ActiveRecord objects 99% of the time, bonus points for in-memory CSV reading or write buffers). Rails applications don't have to balloon in memory.
- FooBarWidget 5y ago> If you're running (say) 10 Rails processes on a machine with 10 GB RAM, and particular request paths/background jobs whatever pushes the process size to 2 GB RAM size, you can release the memory back to the OS after you're done, but you still have the underlying problem which is the process gets to that size in the first place, and if all the processes hit 2GB at once, now you're 10 GB in debt, either in swap, or OOM errors. Fullstaq Ruby author here. I have done research on the memory bloat problem[1], and this statement is not true. With the way memory allocation in glibc's ptmalloc2 works, multithreaded processes can reach bloaty proportions even if they don't do much work. I started investigating this whole issue because I had a trivial Ruby HTTP proxy server: it had no reason to use 1.3 GB of memory, it doesn't do anything besides forwarding small requests. That's when I found that ~1 GB of that 1.3 GB of memory wasn't even due to anything that my app did by itself, but it's just how the memory allocator works. [1] https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html https://www.joyfulbikeshedding.com/blog/2019-03-14-what-caus...
- powerlogic31 5y agoruby on rails! the horror
- jbotdev 5y agoMaybe I’m missing something, but it seems the only changes here over upstream are jamlloc and/or malloc_trim. I’m not as familiar with malloc_trim, but jemalloc is fairly trivial to setup without recompiling Ruby (using LD_PRELOAD), and there are even buildpacks for environments like Heroku. It seems like more time was spent on the marketing page than on the actual optimizations.
- FooBarWidget 5y agoHere I explain why it can quickly become not so trivial: https://news.ycombinator.com/item?id=27872696 https://news.ycombinator.com/item?id=27872696 The goal of Fullstaq Ruby is to democratize the fight against Ruby memory bloat. Democratization means that as many people should be able to reap the benefits as possible. It's 2021 now, and expecting users to compile Ruby or Jemalloc from source is no longer realistic. Compiling anything is no longer a non-scary, low-friction thing to do.
- wgjordan 5y agoThe parent comment noted that using jemalloc for Ruby without compiling is already trivially easy, so the argument that 'compiling is hard' is irrelevant even if true. The real argument is that installing jemalloc separately and running Ruby with an environment variable is too hard.
- FooBarWidget 5y agoIn my comment, as well as in the FAQ, I explain why even using Jemalloc _without_ compiling Ruby has its own caveats. The Jemalloc version matters a lot. For reasons that are not yet clear, significant memory savings are only achieved with Jemalloc 3, not with Jemalloc 5. Your distribution only ships one Jemalloc version. So likely you need to compile Jemalloc 3 yourself. Here you are already entering compilation land. But Jemalloc 3 no longer compiles by default on some modern distributions, such as Debian 10. Fullstaq Ruby fixes this by patching Jemalloc for you. Furthermore, which Ruby binaries are you using? The ones provided by the Linux distribution are perpetually outdated. Another of Fullstaq Ruby's value proposition is that we supply binaries for the latest Ruby version, quickly. We packaged Ruby 3.0 on the same day it came out. "Fullstaq Ruby vs LD_PRELOADing Jemalloc yourself": https://github.com/fullstaq-labs/fullstaq-ruby-server-edition#vs-ld_preloading-jemalloc-yourself https://github.com/fullstaq-labs/fullstaq-ruby-server-editio...
- rubyn00bie 5y agoIs this like a fancy new modern version REE (Ruby Enterprise Edition)? It’s got that vibe. Edit: yep, exactly that.
- snowmaker 5y agoWow, I'm really excited about this. Running a large rails website, we spent egregious amounts of money getting EC2 instances with extra ram. If they can fulfill their promise of reducing memory usage by 50%, that'll save us tens of thousands of dollars.