[Mongrel] multi threaded theoretically useful?

Kirk Haines wyhaines at gmail.com
Tue Sep 11 16:40:54 EDT 2007

On 9/11/07, Ashley Moran <work at ashleymoran.me.uk> wrote:

> There's a postgres-pr gem, but I don't use it myself.  I tell people
> running Windows they need it, but I always go for the C version
> myself.  If I was in a situation where I had a lot of long-running
> queries, would I be better with the pure Ruby interface from a
> concurrency point of view?
> (I'm assuming that as Ruby VMs improve, this will become true in any
> case)

It depends.  In _general_, the blocking, C extension based drivers
will still net you better performance, currently, becase they are so
much faster than the pure ruby drivers.  Additionally, because they
are typically just interfaces to the database's own API layer, you
know that they are stable and compatible, while the pure ruby
implementations may not be as stable.

However, if a large number of your queries are very slow, then there
may be room to use some of those wasted cycles by using a
multithreaded deployment.  It's something that one would really have
to benchmark to know for sure for any given use case.

Kirk Haines

More information about the Mongrel-users mailing list