LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Ruby/Rails (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=20)
-   -   Fibers (rails, ruby 1.9) and SAPI (http://www.litespeedtech.com/support/forum/showthread.php?t=4228)

Grzegorz Derebecki 08-10-2010 06:37 AM

Fibers (rails, ruby 1.9) and SAPI
 
Did you plan support Fibers in sapi?

What is Fibers? It is async no- blocking rails instances that can handle more that 1 request at the same time (no threads!).

More info you can get here: http://blog.envylabs.com/2010/07/no-...eads-ruby-1-9/

I tested it with Thin and works greate - from 0.5 req/s (slow action) i get to 2.4 r/s on ruby instance.

I'm consider to switch from sapi to thin if you not plan support it.

mistwang 08-12-2010 11:16 AM

This is a dramatic change in ruby/rails infrastructure, not sure it is can be mature enough and being adopted widely. After all, many code is not friendly with non-blocking mode. It is going to be disastrous if ruby blocked somewhere for some reason.

It could save on memory, but I am not sure it going to be really faster than profork mode, comparing one non-blocking ruby handling 10 concurrent requests to 10 prefork ruby handling 10 concurrent requests. The non-blocking ruby may not able to take advantage SMP server if only one instance is used.

We will see how it evolves then make decision on whether to provide a non-blocking LSAPI interface.

Grzegorz Derebecki 08-12-2010 11:55 AM

Quote:

Originally Posted by mistwang (Post 20962)
This is a dramatic change in ruby/rails infrastructure, not sure it is can be mature enough and being adopted widely. After all, many code is not friendly with non-blocking mode. It is going to be disastrous if ruby blocked somewhere for some reason.

It could save on memory, but I am not sure it going to be really faster than profork mode, comparing one non-blocking ruby handling 10 concurrent requests to 10 prefork ruby handling 10 concurrent requests. The non-blocking ruby may not able to take advantage SMP server if only one instance is used.

We will see how it evolves then make decision on whether to provide a non-blocking LSAPI interface.

Here is exemple app http://github.com/igrigorik/async-rails/
There is already mysql async gem, rack async (rack-fiber_pool) and http async.

I'm wonder if we can join prefork with fibers (lets say 4 rails process all supports async request).


All times are GMT -7. The time now is 01:09 AM.