Hi,

After your suggestion i changed code
String SOLR_URL="http://localhost:7991/solr/actionscomments";;
SolrClient solrClient = new HttpSolrClient.Builder(SOLR_URL).build();
SolrInputDocument document = new SolrInputDocument();
document.addField("id","ACTC6401895");
solrClient.add(document);
solrClient.commit();

Still my CPU usage went high and my CPU has 4 core and no other application 
running in my machine.

After the lots of try, I found out the below issue.
Before solrconfig.xml (6.1.0)
<autoCommit>
       <maxTime>600000</maxTime>
       <maxDocs>20000</maxDocs>
       <openSearcher>false</openSearcher>
 </autoCommit>

After the below change in solrconfig.xml
<autoCommit> (8.0.0)
       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
       <maxDocs>20000</maxDocs>
       <openSearcher>false</openSearcher>
 </autoCommit>

Actually I am upgrading solr 6.1.0 to 8.0.0. In 6.1.0 it is working fine with 
autocommit maxtime 600000.
But in 8.0.0, CPU usage goes high.[commitScheduler thread running long time]

Please give me more details why is it happening in solr 8.0.0.
Is any my mistake? In previous mail, I attached solrconfig.xml so please verify 
it.


Sent from Outlook<http://aka.ms/weboutlook>
________________________________
From: Shawn Heisey <apa...@elyograg.org>
Sent: Tuesday, April 9, 2019 1:38 PM
To: solr-user@lucene.apache.org
Subject: Re: Solr 8.0.0 - CPU usage 100% when indexed documents

On 4/8/2019 11:00 PM, vishal patel wrote:
> Sorry my mistake there is no class of that.
>
> I have add the data using below code.
> CloudSolrServer cloudServer = new CloudSolrServer(zkHost);
> cloudServer.setDefaultCollection("actionscomments");
> cloudServer.setParallelUpdates(true);
> List<SolrInputDocument> docs = new ArrayList<>();
> SolrInputDocument solrDocument = new SolrInputDocument();
> solrDocument.addField("id", "123");
> docs.add(solrDocument);
> cloudServer.add(docs, 1000);

Side note:  This code is not using SolrJ 8.0.0.  CloudSolrServer was
deprecated in version 5.0.0 and completely removed in version 6.0.0.
I'm surprised this code even works at all with Solr 8.0.0 -- you need to
upgrade to SolrJ 8 and use CloudSolrClient.

How long does the system remain at 100 percent CPU when you index that
single document that only has one field?  If it's longer than a very
small fraction of a second, then my guess is that it's cache warming
queries using the CPU, not the indexing itself.

How many CPU cores are at 100 percent?  Is it just one, or multiple?  It
would be odd for it to be multiple, unless there is other activity going
on at the same time.

Thanks,
Shawn

Reply via email to