[ 
https://issues.apache.org/jira/browse/SOLR-17340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860407#comment-17860407
 ] 

Pierre Salagnac commented on SOLR-17340:
----------------------------------------

I'm opening a pull request for this.

I also ran a very naive benchmark on my laptop, with and without the fix, to 
validate there is a real improvement. After a warmup, it sequentially sends 10K 
requests to {{/info/system}} endpoint and check runtimes.

 
{code}
*** WITHOUT THE FIX ***
QTime  : avg:1.022 max:13 
Elapsed: avg:1.1593 max:51 
{code}

{code}
***  WITH THE FIX ***
QTime  : avg:0.0128 max:3 
Elapsed: avg:0.237 max:16 
{code}

Max times are not very relevant since there are lot of variations between runs. 
But I always see significant improvements in returned QTimes !

> Call to /solr/admin/info/system is abnormally slow
> --------------------------------------------------
>
>                 Key: SOLR-17340
>                 URL: https://issues.apache.org/jira/browse/SOLR-17340
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 9.6
>            Reporter: Pierre Salagnac
>            Priority: Minor
>
> Solr endpoint {{/solr/admin/info/system}} is used to return some generic 
> system metrics (memory, JVM...)
> This endpoint is also used by {{solr-operator}} by default for start-up probe 
> and liveness probe. (details 
> [here|https://github.com/apache/solr-operator/blob/5fec11f8ef181a58b1f72123b44ae6532c49b62d/controllers/util/solr_security_util.go#L44]).
>  Very long runtime can cause failures of the probes.
> Runtime is abnormally slow because of the time spent in introspecting beans 
> to create {{BeanInfo}} instances. Most of the time is spent here:
> {code}
> java.lang.Exception: Stack trace
>       at 
> java.desktop/java.beans.Introspector.getBeanInfo(Introspector.java:279)
>       at 
> org.apache.solr.util.stats.MetricUtils.addMXBeanMetrics(MetricUtils.java:777)
>       at 
> org.apache.solr.util.stats.MetricUtils.addMXBeanMetrics(MetricUtils.java:841)
>       at 
> org.apache.solr.handler.admin.SystemInfoHandler.getSystemInfo(SystemInfoHandler.java:223)
>       at 
> org.apache.solr.handler.admin.SystemInfoHandler.handleRequestBody(SystemInfoHandler.java:156)
>       at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:248)
>       at org.apache.solr.handler.admin.InfoHandler.handle(InfoHandler.java:96)
>       at 
> org.apache.solr.handler.admin.InfoHandler.handleRequestBody(InfoHandler.java:84)
>       at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:248)
> {code}
> There is no need to execute the bean introspection at each call. We could 
> lazily instantiate them and keep them in memory for efficiency.
> Note: I haven't been able to figure out the exact cause, but the runtime can 
> exponentially increase under heady querying load.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to