You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Dominic Tarr <do...@gmail.com> on 2011/09/27 11:40:02 UTC

scalabitily of the _changes feed

is it okay to register a huge number of listeners to the changes feed?

I notice that you can use a filter function, which gets passed the request
parameters,
does this mean that the filter function will be called for each doc, for
each listener on the changes feed?
or are the results of each filter call cached so that it is possible to
efficiently register many listeners using the same filter function?

cheers, Dominic

Re: scalabitily of the _changes feed

Posted by Mikeal Rogers <mi...@gmail.com>.
If you're going to do a ton of filters (one per user) you should really go with something in an application server handling the filters.

Check out Jason Smith's follow library since I know you're a node.js programmer :)

https://github.com/iriscouch/follow

It's crazy stable, it's used all over in the IrisCouch infrastructure.

-Mikeal

On Sep 27, 2011, at September 27, 201111:40 AM, Dominic Tarr wrote:

> is it okay to register a huge number of listeners to the changes feed?
> 
> I notice that you can use a filter function, which gets passed the request
> parameters,
> does this mean that the filter function will be called for each doc, for
> each listener on the changes feed?
> or are the results of each filter call cached so that it is possible to
> efficiently register many listeners using the same filter function?
> 
> cheers, Dominic


Re: scalabitily of the _changes feed

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Sep 27, 2011 at 11:40 AM, Dominic Tarr <do...@gmail.com> wrote:
> is it okay to register a huge number of listeners to the changes feed?
>

It will open one socket / feed. So it depends on your os limits
mostly. You will have to tune the backlog & fd limit for a start.


> I notice that you can use a filter function, which gets passed the request
> parameters,
> does this mean that the filter function will be called for each doc, for
> each listener on the changes feed?

Yes

> or are the results of each filter call cached so that it is possible to
> efficiently register many listeners using the same filter function?

It isn't cached in couch, but you can cache it on your applications.

- benoƮt