3 ms·
From the Reddit thread linked above (lots of context there, worth reading), the author answers: > what's the main benefit? Drastically reduced memory usage by
by aeontech 4y ago
From the Reddit thread linked above (lots of context there, worth reading), the author answers:
> what's the main benefit?
Drastically reduced memory usage by improving Copy-on-Write performance. For mid-sized apps it can even use less memory than puma depending on how you set it up. See this synthetic benchmark.
> Why did you decide to build reforking into a fork of Unicorn instead of contributing it to Puma?
Mostly for simplicity. You can build this in Puma, but there are a few extra challenges.
For instance you don't want to refork when another thread is currently processing a request, you'd risk leaving some global resource in a corrupted state. So you'd first need to stop accepting traffic and wait for all requests to complete.
The problem is, Puma doesn't have a request timeout, so if the request never complete, what do you do?
Lots of small challenges like that. But I think it would be awesome if Puma was to take back that idea. Puma's fork_worker feature was a big part of the inspiration after all, and I'd even be happy to help Nate or someone else do it.