--0015175df44c3ad6f404b015fda5
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Oct 24, 2011 at 2:26 PM, wam r. <wamrewam / googlemail.com> wrote:

> Hi guys,
>
> It is difficult to describe the load: it is a Rails app with many moving
> parts. By "loading" I mean I am sending 10 to 20 requests at once (and
> repeat) just to see how it reacts.
>
> I have been able to "track" the key time consuming parts in my code.
> There are three of them:
> - one linked to DB requests
> - one linked to heavy computations (some optimization algos)
> - the third one: the thread creation above.
>
> The more I load, the more time each of these take - it is very
> correlated.


Hi there.

Keep in mind Ruby 1.8.7 doesn't have real threads, it has "green threads"
which are scheduled by the VM.

If you are using database drivers that make blocking system calls, they have
the potential to block the entire VM as 1.8.7 can only make one system call
at once.

If you are making heavy use of threads in Ruby, you should also consider
moving to JRuby or Rubinius, which both support true concurrent
multithreading with no Global Interpreter Lock.

-- 
Tony Arcieri

--0015175df44c3ad6f404b015fda5--