Thanks, Shawn. This is very helpful. I will use this solution!

On Sun, Nov 20, 2022 at 12:56 PM Shawn Heisey <apa...@elyograg.org> wrote:

> On 11/19/22 21:38, gnandre wrote:
> > Thanks, Shawn. I am a bit wary of creating a total core just for this
> > health check purpose.
> > Isn't it a bit expensive to create a core, considering the caches and so
> > many things it registers? Or, is it fine in which case I might just
> proceed
> > with that solution.
>
> I'm talking about a completely empty core that you never send queries
> to.  If it never gets queries, it should not need any significant memory
> for caching.
>
> This is the absolute minimum config and schema I was able to use to make
> a new core like what you would need.  There are no cache definitions, so
> the Solr caches should not even be created.  It would probably still
> create some Lucene caches, but as those would be empty, they would be
> very small.  With this definition I don't think you CAN send it any
> queries:
>
> solrconfig.xml:
> ---
> <?xml version="1.0" encoding="UTF-8" ?>
> <config>
>    <luceneMatchVersion>LATEST</luceneMatchVersion>
>    <requestHandler name="/your/handler/path" class="YOURCLASSNAME">
>      *** ANY CONFIG NEEDED FOR YOUR HANDLER ***
>    </requestHandler>
> </config>
> ---
>
> managed-schema.xml:
> ---
> <?xml version="1.0" encoding="UTF-8"?>
> <schema name="empty" version="1.6">
>    <fieldType name="string" class="solr.StrField" omitNorms="true"
> sortMissingLast="true" docValues="true"/>
>    <fieldType name="long" class="solr.LongPointField"
> positionIncrementGap="0" docValues="true"/>
>    <field name="id" type="string" indexed="true" required="true"
> stored="true"/>
>    <field name="_version_" type="long" indexed="false" stored="false"/>
>    <uniqueKey>id</uniqueKey>
> </schema>
> ---
>
> This should result in the absolute minimum memory footprint for a core.
> Probably only a few megabytes.  And I think there is some work underway
> to try and reduce the memory footprint for all cores in some future
> version of Solr.  That would in theory make the memory requirement for
> this core even smaller.
>
> In the future I hope that we can provide a way for users to register
> global handlers and make this empty core nonsense unnecessary.
>
> Thanks,
> Shawn
>
>

Reply via email to