On Thursday, August 23, 2012 3:34:57 PM UTC-7, Ravi wrote:
>
> I have written a multi threaded code to update db.Number of threads may 
> range from 45-50 or even more.
>
> Getting following error Mysql::Error: Too many connections 
> (Sequel::DatabaseConnectionError)
>

That's a error raised by the database server telling you you have too many 
connections to the server. That's not necessarily all connections from 
Sequel, it includes any other connections to the database (mysql command 
line program, a graphical mysql client, etc.).

You can't change the number of allowed connections from Sequel, you need to 
change your MySQL database configuration to increase the number of 
connections.  The only work around in Sequel is lowering the number of 
connections that Sequel will create (like you saw, the default is 4).  You 
mentioned raising the number from 4 to 30, which could be causing your 
problem.  Do you get the same error message when running with the default 
of 4 connections?

Note that you can have a connection pool with 4 connections serve 50 
threads, as long as each thread on average accesses the database 8% of the 
time.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/atCgsjZiq00J.
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