Reputation: 401
We are using solr multicore environment for production and we have hundreds of users, each having 1 core.
The problem is: when most of the users access solr concurrently, the related cores get initialized and solr is not clearing memory used by unused cores in RAM automatically. Consequently, server RAM usage goes to critical. So to fix this, we have to restart the server every single time. It is not a dedicated server and therefore, if RAM usage increases, other shared resources might get affected.
So how do we clear unused cores from RAM memory? Is there any api or workaround to achieve this in solr?
Upvotes: 0
Views: 283
Reputation: 52832
There are a few settings that allow you to handle unloading of cores more dynamically. First, you'll need to mark each core as transient="true"
, meaning that the core can be unloaded if the amount of cores exceeds transientCacheSize
. The latter is an option you can add within your <solr>
element in solr.xml
, while the former is for each core definition (in core.properties). You can also provide transient=true when creating a core through the API. The size of transientCacheSize
will have to be tuned to the load you're seeing, the size of the cores and the amount of memory available (and used for each core).
It sounds like you've already discovered loadOnStartup
which tells Solr if it should attempt to bring the core into memory when the application container starts, or wait until it's actually going to be used.
The Lots of Cores Wiki Page also has a long list of Solr issue tickets that you can dig into to learn more about the features.
Upvotes: 2