I used the node-mongodb-native in some projects, i confused by a problem that when and how to use poolsize in MongoDB native driver;can you help me to resolve this problem? Thank you.
On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiangli...@gmail.com> wrote:
> I used the node-mongodb-native in some projects, i confused by a problem
> that when and how to use poolsize in MongoDB native driver;can you help
> me to resolve this problem? Thank you.
Are you sure Wes? I was of the impression that it actually creates
multiple connections with the database servers, thereby achieving
asynchornous queries. With one connection you cannot perform queries
asynchronously.
I would consider this normal behavior. In fact I believe that the
default pool size should be bigger than one, because the current
setting of one may cause people to rely on the accompanying
"unintentioned synchronousness".
On Mon, Sep 17, 2012 at 8:48 AM, Wes Freeman <freeman....@gmail.com> wrote:
> It's for when you want to be able to use the connection to do more than one
> query at a time.
> This is a bit tricky, because you do queries asynchronously, so you might
> end up doing more than one at a time unintentionally.
> Wes
> On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiangli...@gmail.com> wrote:
>> I used the node-mongodb-native in some projects, i confused by a problem
>> that when and how to use poolsize in MongoDB native driver;can you help me
>> to resolve this problem? Thank you.
I know that by default it only uses one connection, but maybe it can handle
multiple queries at once without safe:true. Maybe I'm thinking of when you
use safe:true and callbacks... it's been a while since I was deeper in the
driver. Anyone else want to chime in?
On Sun, Sep 16, 2012 at 9:53 PM, Tom <tommed...@gmail.com> wrote:
> Are you sure Wes? I was of the impression that it actually creates
> multiple connections with the database servers, thereby achieving
> asynchornous queries. With one connection you cannot perform queries
> asynchronously.
> I would consider this normal behavior. In fact I believe that the
> default pool size should be bigger than one, because the current
> setting of one may cause people to rely on the accompanying
> "unintentioned synchronousness".
> Tom
> On Mon, Sep 17, 2012 at 8:48 AM, Wes Freeman <freeman....@gmail.com>
> wrote:
> > It's for when you want to be able to use the connection to do more than
> one
> > query at a time.
> > This is a bit tricky, because you do queries asynchronously, so you might
> > end up doing more than one at a time unintentionally.
> > Wes
> > On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiangli...@gmail.com> wrote:
> >> I used the node-mongodb-native in some projects, i confused by a problem
> >> that when and how to use poolsize in MongoDB native driver;can you
> help me
> >> to resolve this problem? Thank you.
Sorry Tom, I totally misread your comment. Yes, it (pooling) is for having
multiple connections open to the server so that you can run multiple
queries/inserts/updates at the same time. It actually does create multiple
connections with connection pooling enabled. That's what I meant to say in
my initial response, but I was less than clear.
On Sun, Sep 16, 2012 at 10:03 PM, Wes Freeman <freeman....@gmail.com> wrote:
> I know that by default it only uses one connection, but maybe it can
> handle multiple queries at once without safe:true. Maybe I'm thinking of
> when you use safe:true and callbacks... it's been a while since I was
> deeper in the driver. Anyone else want to chime in?
> On Sun, Sep 16, 2012 at 9:53 PM, Tom <tommed...@gmail.com> wrote:
>> Are you sure Wes? I was of the impression that it actually creates
>> multiple connections with the database servers, thereby achieving
>> asynchornous queries. With one connection you cannot perform queries
>> asynchronously.
>> I would consider this normal behavior. In fact I believe that the
>> default pool size should be bigger than one, because the current
>> setting of one may cause people to rely on the accompanying
>> "unintentioned synchronousness".
>> Tom
>> On Mon, Sep 17, 2012 at 8:48 AM, Wes Freeman <freeman....@gmail.com>
>> wrote:
>> > It's for when you want to be able to use the connection to do more than
>> one
>> > query at a time.
>> > This is a bit tricky, because you do queries asynchronously, so you
>> might
>> > end up doing more than one at a time unintentionally.
>> > Wes
>> > On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiangli...@gmail.com> wrote:
>> >> I used the node-mongodb-native in some projects, i confused by a
>> problem
>> >> that when and how to use poolsize in MongoDB native driver;can you
>> help me
>> >> to resolve this problem? Thank you.
On Sunday, September 16, 2012 10:11:52 PM UTC-4, Wes Freeman wrote:
> Sorry Tom, I totally misread your comment. Yes, it (pooling) is for having > multiple connections open to the server so that you can run multiple > queries/inserts/updates at the same time. It actually does create multiple > connections with connection pooling enabled. That's what I meant to say in > my initial response, but I was less than clear.
> On Sun, Sep 16, 2012 at 10:03 PM, Wes Freeman <freem...@gmail.com<javascript:> > > wrote:
>> I know that by default it only uses one connection, but maybe it can >> handle multiple queries at once without safe:true. Maybe I'm thinking of >> when you use safe:true and callbacks... it's been a while since I was >> deeper in the driver. Anyone else want to chime in?
>> On Sun, Sep 16, 2012 at 9:53 PM, Tom <tomm...@gmail.com <javascript:>>wrote:
>>> Are you sure Wes? I was of the impression that it actually creates >>> multiple connections with the database servers, thereby achieving >>> asynchornous queries. With one connection you cannot perform queries >>> asynchronously.
>>> I would consider this normal behavior. In fact I believe that the >>> default pool size should be bigger than one, because the current >>> setting of one may cause people to rely on the accompanying >>> "unintentioned synchronousness".
>>> Tom
>>> On Mon, Sep 17, 2012 at 8:48 AM, Wes Freeman <freem...@gmail.com<javascript:>> >>> wrote: >>> > It's for when you want to be able to use the connection to do more >>> than one >>> > query at a time.
>>> > This is a bit tricky, because you do queries asynchronously, so you >>> might >>> > end up doing more than one at a time unintentionally.
>>> > Wes
>>> > On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiang...@gmail.com<javascript:>> >>> wrote:
>>> >> I used the node-mongodb-native in some projects, i confused by a >>> problem >>> >> that when and how to use poolsize in MongoDB native driver;can you >>> help me >>> >> to resolve this problem? Thank you.
On Sun, Sep 16, 2012 at 11:03 PM, christkv <chris...@gmail.com> wrote:
> The driver defaults to 5 connections these days (poolSize:5).
> On Sunday, September 16, 2012 10:11:52 PM UTC-4, Wes Freeman wrote:
>> Sorry Tom, I totally misread your comment. Yes, it (pooling) is for
>> having multiple connections open to the server so that you can run multiple
>> queries/inserts/updates at the same time. It actually does create multiple
>> connections with connection pooling enabled. That's what I meant to say in
>> my initial response, but I was less than clear.
>> On Sun, Sep 16, 2012 at 10:03 PM, Wes Freeman <freem...@gmail.com> wrote:
>>> I know that by default it only uses one connection, but maybe it can
>>> handle multiple queries at once without safe:true. Maybe I'm thinking of
>>> when you use safe:true and callbacks... it's been a while since I was
>>> deeper in the driver. Anyone else want to chime in?
>>> On Sun, Sep 16, 2012 at 9:53 PM, Tom <tomm...@gmail.com> wrote:
>>>> Are you sure Wes? I was of the impression that it actually creates
>>>> multiple connections with the database servers, thereby achieving
>>>> asynchornous queries. With one connection you cannot perform queries
>>>> asynchronously.
>>>> I would consider this normal behavior. In fact I believe that the
>>>> default pool size should be bigger than one, because the current
>>>> setting of one may cause people to rely on the accompanying
>>>> "unintentioned synchronousness".
>>>> Tom
>>>> On Mon, Sep 17, 2012 at 8:48 AM, Wes Freeman <freem...@gmail.com>
>>>> wrote:
>>>> > It's for when you want to be able to use the connection to do more
>>>> than one
>>>> > query at a time.
>>>> > This is a bit tricky, because you do queries asynchronously, so you
>>>> might
>>>> > end up doing more than one at a time unintentionally.
>>>> > Wes
>>>> > On Sun, Sep 16, 2012 at 9:12 PM, Li Jiang <jiang...@gmail.com> wrote:
>>>> >> I used the node-mongodb-native in some projects, i confused by a
>>>> problem
>>>> >> that when and how to use poolsize in MongoDB native driver;can you
>>>> help me
>>>> >> to resolve this problem? Thank you.
> I used the node-mongodb-native in some projects, i confused by a problem > that when and how to use poolsize in MongoDB native driver;can you help > me to resolve this problem? Thank you.