El Jueves, 17 de Diciembre de 2009, Iñaki Baz Castillo escribió:
> El Jueves, 17 de Diciembre de 2009, Iñaki Baz Castillo escribió:
> > Hi, AFAIK Ruby C mysql driver is blocking so Ruby must wait until get a
> > response.
> > So what's the advantage of using "single_threaded = false"? With this
> > option Sequel creates a pool of connections to the DB while when using
> > "single_threaded = true" it just mantain a single connection. Is it
> > right?
>
> Perhaps I'm wrong and "single_threaded" has no relationship with
> "max_connections"... am I right?
>
My app doesn't use threads (but an event based server to handle HTTP
requests).
I use Sequel with MySQL adapter:
:single_threaded => false # doesn't matter IMHO
:max_connections => 4
Now I do a DB query like this:
DB.run("SELECT sleep(4)")
At the same time I do any other "normal" SQL query. It's not attended until
the previous blocking query terminates. Is it the expected behaviour? What is
the point of having 4 DB connections available?
I've also tryed the same but using "mysqlplus" instead of "mysql". The result
is the same. I think that "mysqlplus" just offers advantages is the
application on top of it makes usage of async methods. If not, it behaves
exactly as "mysql" driver.
Thanks for any comment.
--
Iñaki Baz Castillo <[email protected]>
--
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.