couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Katz <>
Subject Re: all_dbs_active - what should an app do when it gets this?
Date Mon, 23 Nov 2009 23:41:20 GMT

On Nov 23, 2009, at 5:41 PM, Paul Davis wrote:

> On Mon, Nov 23, 2009 at 5:35 PM, Jeff Macdonald < 
> > wrote:
>> Hi all,
>> I have a simple app that is creating a lot of databases. Eventually
>> when I get to some number of databases, I get this error
>> all_dbs_active on insert. I thought I just sleep (ick) and try again,
>> but when I went to Futon after the program was done for many minutes,
>> I get that error in the web interface too. So I'm rather puzzled at
>> what to do. I'm sure there is some config var somewhere where I can  
>> up
>> that limit, but I'm more interested in what the proper thing to do
>> when such a limit is met.
>> TIA
>> --
>> Jeff Macdonald
>> Ayer, MA
> Other than increase the max_open_dbs configuration option, I can't
> think of anything 'elegant' that you could do client side other than
> backoff in your script for the db creation/access rate.
> The limit comes from trying to avoid throwing random file descriptor
> limit errors, so I'm not sure what the best solution would be. It'd
> theoretically be possible to create a queue that would just block
> client access to a db until there was an active slot available, but
> that could be easily pushed into starvation if the open db's remain
> active long enough which could be indefinite with things like
> continuous replication IIUC.

Yeah, the limit is 100 open dbs at a time. Databases that are being  
compacted or having views built will cause the dbs to remain open even  
if no clients are actively access the server. Continuous replication  
shouldn't keep the dbs open unless it's actively replicatng changes.

You can up the open db limit to whatever you want, but you might have  
to boost the open files allowable in the OS settings somewhere.

If you are hitting the limit, but don't have enough clients accessing  
the dbs, and have no views being built and no compactions happening,  
it might be bug in CouchDB.


> HTH,
> Paul Davis

View raw message