On Wed, Aug 29, 2012 at 10:51 AM, Ravi <[email protected]> wrote:

>
>
> On Tuesday, August 28, 2012 6:58:53 PM UTC-7, Jeremy Evans wrote:
>>
>> On Tuesday, August 28, 2012 5:13:33 PM UTC-7, Ravi wrote:
>>>
>>> Increasing max_connection also not working. I ran the application 50-60
>>> times in few span of seconds (at each call it creates 3-4 databse objects)
>>> and now it is giving me same error. "Too many connections"
>>
>>
>> Is there a reason that you are running 50-60 copies of the application,
>> and creating 3-4 Database objects in each one?  That sounds like a very
>> poor design to me.
>>
> Yes, this is the requirement. There can be multiple users
> accessing/running this program. Just out of curious, what is the drawback
> of creating more than one db object say 2 or 3?
>

You're hitting an issue with your database. No matter what tricks you pull
in an application, if you open 50-60 copies and create 3-4 connections/copy
- you are going to have 150-240 connections to your database. If your
database allows 100 connections max - you have a problem that no amount of
Ruby code will fix as long as you run that many applications at the same
time.

If you have some absolute requirement that the application needs to run
that many copies - then you either need to open up the max amount of
connections allowed in your database - or create some form of proxy that
can sit in the middle and relay the requests between your app and the
database. Your proxy would be able to accept as many connections as you
want and open up as many connections as needed/allowed to the database.

John

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-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/sequel-talk?hl=en.

Reply via email to