[Rails] Database Concurrency Without a Web Server?

Isak Hansen
Wed, 12 Jul 2006 21:03:56 -0000

On 7/11/06, Don Stocks <amillionhitpoints@yahoo.com>
wrote:
> My Rails application requires a very busy worker process running in the
> background at all times.  I am launching this non-interactive process
> using script/runner.  This process is very busy and is communicating
> with the MySQL server constantly.  As I started putting some load on the
> system to test, I started running into performance issues.
>
> I have since discovered that Rails is only using 1 database connnection
> in this context.  When monitoring the database, MySQL reports only 1
> connection and 1 thread, even during very busy times.  It doesn''t
look
> like Rails is using database connection pooling when ActiveRecord is
> being used in this context (stand alone).
>
> The big question:  How can I get database connection pooling when
> running a non-interactive Rails application via script/runner?
>
> Without this I may be dead in the water.
>
> Thanks!
>
>  - Don

You''re sure (lack of) connection pooling is where your problem is
really at? Keep in mind that one connection is all you''ll ever need
for a single process.


Isak