|Thin 2.0 pre-release||macournoyer||9/22/12 1:17 PM|
I've been working on version 2.0 of Thin on and off for quite some time now. It's a complete rewrite with better performance, more portable (based on the cross-platform http-parser.rb), more HTTP compliant and more features. And I believe it's ready for testing. But perhaps not ready for production use yet.
== What's new in 2.0?
- Prefork model with an EventMachine loop running in each worker. (Imagine Thin and Unicorn having a child.)
- Optional single process mode for non-UNIX systems and simpler deployments. (In case your OS doesn't support fork)
- Optional threaded mode using a pool of threads. (If your app code is slow)
- Easy asynchronous streaming response support with chunked encoding. (Easier API to use and also now fully HTTP compliant w/ chunked encoding)
- Fast file serving with automatic streaming for large files. (You know on Heroku Cedar stack your files are served by the Ruby server right? Well now it will be fast and use less memory)
== Trying it now!
gem install thin --pre
Or check the source: https://github.com/macournoyer/thin/tree/v2
Let me know if you encounter any bug or weird behaviour.
Hope you like it :)
|Re: Thin 2.0 pre-release||Dave Kapp||10/2/12 8:53 AM|
I don't know if I'll get a chance to try it anytime in the near future or not, but the features you list there sound awesome! Congrats on moving forward with the new release and I look forward to using it when I can :)
|Re: Thin 2.0 pre-release||Sagar Ranglani||10/10/12 11:18 PM|
|Re: Thin 2.0 pre-release||Adrian Marius Popa||10/31/12 7:45 AM|
|Re: Thin 2.0 pre-release||macournoyer||10/31/12 12:44 PM|
I wouldn't call it a feature... Hopefully the patch required by Thin will be included in EventMachine and we can rely on it instead of a fork.
|Re: Thin 2.0 pre-release||Jonathan Rochkind||11/4/12 12:29 PM|
> - Optional threaded mode using a pool of threads. (If your app code is slow)
I'm actually particularly excited about that feature, I hope it makes it in and becomes a mature and robust feature.
Single-process multi-threaded request handling can actually result in a lot of capacity not only if your app code is slow -- but if your app is I/O bound, as many apps are -- if your app is I/O bound, then even on MRI with the GIL. And could be a cheaper option to handle more traffic on platforms that charge per-process (heroku, more or less), compared to multi-process scale-out.
Rails 4.0 is slated to have `config.threadsafe!` on by default at least in production (http://tenderlovemaking.com/2012/06/18/removing-config-threadsafe.html). But it wont' matter if hardly anyone is using an app server that can do MT concurrent request dispatching. thin being able to do so could really open that up to 'the masses'. (right now upcoming Passenger Enterprise will do it, but not free passenger. puma will do it. Not sure about others). And the more you can open up concurrent request handling in Rails and the more people using it, the more likely the remaining bugs and mis-designs in rails around multi-threaded concurrency will be noted and fixed.
|Re: Thin 2.0 pre-release||macournoyer||11/4/12 12:41 PM|
Hey thx Jonathan,
Glad you're excited about that feature.
It has been available for a few years in Thin 1.x as an experimental feature, see the --threaded option. But now it will be official!
|RE: Thin 2.0 pre-release||Jonathan Rochkind||11/4/12 1:12 PM|
Yeah, when I looked into thin 1.0 with --threaded, word on 'the street' (the blogosphere etc) was that this feature in thin was not very robust or well-supported, people have had problems with it. Perhaps that was a misperception and I should have been using it all along? Or perhaps you've improved it for 2.0, or perhaps there are problems you didn't know about in it, but if so hopefully making it more official and documented will result in remaining problems being discovered and fixed!
With passenger enterprise (but not free) supporting MT concurrent request dispatching, it will be GREAT to have thin, which is probably the next most popular deploy option, supporting it officially too as a free alternative.
|Re: Thin 2.0 pre-release||Steve Cosman||7/13/13 6:57 AM|
v2 Sounds awesome. Especially if the preforking works with Ruby 2.0's copy-on-write.
Any update on the stability of the V2 branch or timing for a release?