[Rails] Re: Database Concurrency Without a Web Server?

Ezra Zygmuntowicz
Wed, 12 Jul 2006 22:21:38 -0000

On Jul 12, 2006, at 3:01 PM, Don Stocks wrote:

> Don Stocks wrote:
>
>> that all that''s needed for Rails connection pooling?  Will
Rails
>> and the
>> MySQL client (on Linux) make mulitple / simultaneous / non-
>> blocking db
>> queries through one MySQL connection when in the script/runner
>> context?
>
> OK.  I think I answered that question.  Using MySQL Administrator (the
> GUI tool) I can see in the Connection Health monitor there are times
> that more than one query is running at a time.
>
> So if those queries are not blocking then I can rule out the MySQL
> client as the cause of the work slow downs.
>
> Does ActiveRecord::Base.allow_concurrency = true have any affect on
> how
> Rails uses the MySQL client?  Or is this more application framework
> specific?
>
>  - Don


Don-

	AR::Base.allow_concurrency just allows multi threaded access to the
database. It won''t do you any good with a single threaded non-
blocking setup like EventMachine. So I don''t think that setting is
going to help you. I think for how many db hits you are looking to do
per second that maybe the creation of the ruby AR objects is slowing
you down more then anything esle. Have you tried using the mysql-ruby
adapter and hitting the db without going through ActiveRecord?


Cheers-
-Ezra