3 ms·
Neither Puma nor Pitchfork are generally used as a static file server since they're not particularly well-suited to that. They're used as Ruby application serve
by nirvdrum 4y ago
Neither Puma nor Pitchfork are generally used as a static file server since they're not particularly well-suited to that. They're used as Ruby application servers. The memory consumption and savings being discussed is oriented around the memory required by the Ruby VM to process a dynamic request (e.g., a request to a Ruby on Rails application).
- bullen 4y agoOk, I was confused by "minimize memory usage by maximizing Copy-on-Write performance"... That said: Static files never should be chunked. Chunking is ONLY interesting with dynamic responses.
- nirvdrum 4y agoThat's fair. I was trying to guess where the misunderstanding arose from and I guessed wrong. I'm sorry about that. Rounding out the previous thought, the idea with many forking servers is to boot up to the point before a request is served and then fork off for each request. You do gain CoW benefits, but if you have any lazy data structures that are reified in the call, now each child is faulting. Pitchfork will take a child that has processed a request and promote it as the parent, replacing the original process. Now, this new parent is the new CoW base with the expectation that forks from that will result in even greater memory sharing. For a framework like Rails, there's a lot that happens after a request is received.