Frederick Cheung wrote:
On Apr 29, 1:57 am, Joshua Partogi <joshua.part...->[email protected]> wrote:
Hi all,

This is a rather basic question about connection pooling in ruby on
rails. In rails we can define the connection pool in database.yml. I
assume it is quite safe to hardcode this value for intranet
application since we would know how many users that will be using the
apps. But for an internet facing apps where we don't know how many
users that will be accessing the app, how many connection pool should
we provide ? Can anyone share their experience on this to enlighten
me?

Connection pool size isn't really related to number of users. It
doesn't really make much difference without a multithreaded setup (and
your default 'normal' ruby + passenger or mongrel isn't one of those)

Fair enough, in the default state with passenger, you have a multi-process setup, and since each process is independent, they don't know of each other, and thus the value for connection in the database.yml file is more or less meaningless. (It is good to be explicit in explainging why this is the case).

Nevertheless, the database itself may have a limited connection pool, rather than using the standard UNIX model of fork a new process on connection, or othewrwise put a user-configurable constraint on number of active connections. (I undertsand that MySQL often has such a limit.) Any guidance for the original poster on how best to deal with that?

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to