Hi Matthieu,
On 2019-09-02 11:06 a.m., Matthieu Codron wrote:
I need to get the total size for all dbs (ideally for dbs mattching a given
pattern)
What I did until now was
1. /all_dbs to get the list of available dbs
2. /_dbs_infos with the previous list (eventually filtered)
3. sum sizes from sizes.(active|externel|file)
The number of dbs has increased, and I got hit by the limit defined in
max_db_number_for_dbs_info_req .
I have increased this setting, but I suppose 10.000 would not be a
reasonable value! (in fact, I wonder what would be the effect?)
You'll eventually hit the fabric timeout in 2.x and won't be able to
retrieve the information. You could bump that too, but at some point
you'll start affecting the performance of the cluster.
Is there a way to retrieve this size without depending of _dbs_infos?
Yes, you can GET
/_node/_local/_config/chttpd/max_db_number_for_dbs_info_req assuming you
have server admin level access, and you're on CouchDB 2.x. Then you can
just do batches of _dbs_infos that are the right size.
Another option is always to get each DB's info one by one, just via GET
/{db}. This will have all of the info you're looking for.
Additionnaly, I'd like the same for doc_count and doc_del_count.
Similar approach works for these ;)
In case this is not feasible, can I reduce the memory footprint of
/_dbs_info with more than 1.000 dbnames by specifying only some keys to
return?
Not with the _dbs_info endpoint, no.
-Joan