Live data from Hacker News

Pitchfork: Rack HTTP server for shared-nothing architecture

github.com

41–50 of 71 posts

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#41
post #4

I’m still surprised that we haven’t seen much larger improvements in Ruby performance over the last decade given the large number of major tech companies using Rails. Yes, I'm aware of 3x3 but for the most common usage of Ruby which if for Rails apps - there hasn't been anything like the gains PHP saw from 5.x to 7.x. Especially from Microsoft, who has deep compiler/language expertise, and who owns GitHub (large Rail…

>Especially from Microsoft, who has deep compiler/language expertise, and who owns GitHub (large Rails app).

I thought it was missed opportunities those working inside GitHub could not persuade Microsoft to at least budget out additional resources for Ruby. Although they might have their own battle trying to keep everything Rails and not moving to .NET

It does worry me a bit that all resources are coming from Shopify, hopefully they can keep growing so resources isn't a problem in the near future.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#42

For those of you scaling Ruby on Rails: are you more constrained by memory or CPU consumption? If you could choose a 50% reduction in process memory footprint, versus a 50% reduction in CPU cycles to serve your average request, which would you pick?

Database locks is usual issue. Avoidable if planned better. Memory is second. In 15 years CPU has never been a real concern.

Yep agreed - in my experience slow queries eventually cause the web server to back up.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#43
post #39

I have now worked at several significantly-sized companies that ripped Ruby out of everything as they scaled, usually replaced with Go, though none as large as Shopify. I wonder what that financial calculus looks like between these options for a large organization: 1. trying to basically reinvent the workings of an entire programming language and migrate your Ruby apps to these new tools/runtimes/typecheckers/whateve…

> significantly-sized companies that ripped Ruby out of everything as they scaled I am assuming Ruby, used here meant Ruby Rails . Or specifically, ripped Rails out of everything as they scaled? The calculus, in many situation would indeed be in flavour of another framework or language in ~2013. The cost of CPU Core has dropped significantly since then, we are not far from having 128 x86 CPU core in a single socket.…

https://shopify.engineering/porting-yjit-ruby-compiler-to-ru... ??

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#44
post #41
post #4

I’m still surprised that we haven’t seen much larger improvements in Ruby performance over the last decade given the large number of major tech companies using Rails. Yes, I'm aware of 3x3 but for the most common usage of Ruby which if for Rails apps - there hasn't been anything like the gains PHP saw from 5.x to 7.x. Especially from Microsoft, who has deep compiler/language expertise, and who owns GitHub (large Rail…

>Especially from Microsoft, who has deep compiler/language expertise, and who owns GitHub (large Rails app). I thought it was missed opportunities those working inside GitHub could not persuade Microsoft to at least budget out additional resources for Ruby. Although they might have their own battle trying to keep everything Rails and not moving to .NET It does worry me a bit that all resources are coming from Shopify…

You are making multiple comments talking about Microsoft and Shopify not putting resources into Ruby/rails but both companies have core contributors on them.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#45

I have now worked at several significantly-sized companies that ripped Ruby out of everything as they scaled, usually replaced with Go, though none as large as Shopify. I wonder what that financial calculus looks like between these options for a large organization: 1. trying to basically reinvent the workings of an entire programming language and migrate your Ruby apps to these new tools/runtimes/typecheckers/whateve…

> trying to basically reinvent the workings of an entire programming language and migrate your Ruby apps to these new tools/runtimes/typecheckers/whatever

Facebook is probably the best example of this with PHP and Hack [1]

1. https://en.m.wikipedia.org/wiki/Hack_(programming_language)

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#46

Earlier quoted context omitted.

Which part of raw web performance? These don't seem like web performance benchmarks. IOW I'm not sure how calculating digits of PI impacts serving HTML. Seems like we need benchmarks for actual web workloads. :)

PHP vs Ruby in web benchmark across multiple frameworks (and even no use of a framework) linked below. There’s nearly an entire order of magnitude difference in performance between the best of PHP vs best of Ruby (~400k vs ~50k rps) https://www.techempower.com/benchmarks/#section=data-r21&l=z...

Is that an apples to apples comparison taking ngx-php vs roda on puma, esp being on ruby 2.7? Would love to see embedded ruby in nginx instead.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#47
That's a great project, very interested to see how it plays out. In my previous job we used Unicorn but didn't hit any GVL contention issues (much smaller scale than Shopify's).

As a suggestion to the authors: A section titled "Why not Unicorn?" explaining the rationale behind this and why one would want to choose it over Unicorn, would be very helpful. If not in the current experimental stage, then in the "stable" one.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#48

For those of you scaling Ruby on Rails: are you more constrained by memory or CPU consumption? If you could choose a 50% reduction in process memory footprint, versus a 50% reduction in CPU cycles to serve your average request, which would you pick?

Database locks is usual issue. Avoidable if planned better. Memory is second. In 15 years CPU has never been a real concern.

> Database locks is usual issue. Avoidable if planned better.

I've often seen problems because of N+1 querying in particular, but maybe that's just the majority of codebases that I've seen.

> Memory is second. In 15 years CPU has never been a real concern.

In most stacks that I've worked in, memory seems to be the main cause of problems: be it a Ruby application, a PHP one, Python one or Java.

Though perhaps that's because larger servers are expensive and development environments in particular tend to be on the more conservative side of things. Either that, or the apps that I've worked with are good examples of Wirth's law and refuse to even run with less than 2 GB of RAM (though maybe that's more along the lines of commentary about enterprise Java apps in particular). When your development/test server has something like 8 GB of RAM or your computer has 16 GB of RAM and you need to run 7 or 8 of those apps (as well as IDE instances), you run into problems.

CPU is generally not an issue for most applications, though various databases and data stores instead. Perhaps it's batch migrations or just lots of in-database processing, or honestly just most cases where you use ElasticSearch - not only does it seem to eat as much RAM as you'll give it, but the same seems to apply to the CPU (especially when used as the data store for something like Skywalking APM).

On the bright side: most of the modern tech stacks are generally reasonable and there are often micro frameworks (or just more lightweight ones) to be found, which can be suitable for some use cases. Don't want Rails, use Sinatra. Don't want Laravel, use Lumen. Don't want Django, use Flask. Don't want Spring Boot, use Quarkus. That said, Node with Express.js and .NET with ASP.NET are pretty lightweight out of the box, which is nice. Of course, if you go down this route, you might end up with something that is better suited to a bare API, instead of fancy features like server side rendering/templating etc.

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#49
post #39

Earlier quoted context omitted.

> significantly-sized companies that ripped Ruby out of everything as they scaled I am assuming Ruby, used here meant Ruby Rails . Or specifically, ripped Rails out of everything as they scaled? The calculus, in many situation would indeed be in flavour of another framework or language in ~2013. The cost of CPU Core has dropped significantly since then, we are not far from having 128 x86 CPU core in a single socket.…

https://shopify.engineering/porting-yjit-ruby-compiler-to-ru... ??

is the jit. did you understand the art?

Re: Pitchfork: Rack HTTP server for shared-nothing architecture

#50

That's a great project, very interested to see how it plays out. In my previous job we used Unicorn but didn't hit any GVL contention issues (much smaller scale than Shopify's). As a suggestion to the authors: A section titled "Why not Unicorn?" explaining the rationale behind this and why one would want to choose it over Unicorn, would be very helpful. If not in the current experimental stage, then in the "stable" o…

Pitchfork author here.

GVL contention is an issue when using threads of fibers, so it isn’t an issue with Unicorn

Post reply on HN