To make this problem more clear:
Is there a way that not all the queues DBs have to be open at the same
time? I.e. I can imagine writing an algorithm that
closes queue DBs that have not been used recently. So that the
maximum number of file handles at any given time remains constant.
i.e. I could define MAX_FILE_HANDLES
and if NUMBER_OF_QUEUES_OPEN > MAX_FILE_HANDLES
close the least recently used open queue.
The more I think about this, the more I realize this is probably
something that I'll need to write myself, but it seems possible that
BDB's DB manager could perform this sort of management task for you.
-Ben