Hello Marcin, Alas, Lucene does not have this capability out of the box.
However, you are able to live-update the IndexWriterConfig.setRAMBufferSizeMB, and the change should take effect on the next document indexed in that IndexWriter instance. So you could build your own "proportional RAM" on top of that. But I would worry about the little not-accounted-for RAM that IndexWriter uses ... summed across a few thousand instances that might start to matter. When there are no merges running, IndexWriter should be quick to close and re-open; maybe you want to do that more aggressively. Mike McCandless http://blog.mikemccandless.com On Tue, Jun 16, 2020 at 9:25 AM Marcin Okraszewski <okr...@gmail.com> wrote: > Hi, > I want to create a separate index per tenant in application. It is due to > both strong data separation requirements as well as query performance > (active tenants with large indices affect others). The number of active > IndexWriters would go into a few thousands. One of the concerns that rises > is RAM buffers needed by IndexWritters, as even a few MBs of buffer per > writer translates into heavy GBs of RAM. > > Is there any way to give all IndexWriters one cumulative limit of RAM so > that they can share it proportionally to their traffic? > > Thank you, > Marcin >