为什么在我使用SOLR查询所有文档时CPU使用率接近达到100% [英] why CPU usage close to reach to 100% when i use SOLR query all document

查看:364
本文介绍了为什么在我使用SOLR查询所有文档时CPU使用率接近达到100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用SOLR的应用程序来查询200万以上的文档并按时间排序。
像这样的查询URL参数 / select?sort = p_review_date desc& rows = 10& start = 0& q = *:* ,参数start是变量值,每个请求增加10。
当我进行性能压力测试时,SOLR服务器的CPU使用率接近100%。

I have a application using SOLR to query 2 million+ document and sort by time. Query URL param like this /select?sort=p_review_date desc&rows=10&start=0&q=*:*, parameter start is variable value, every request increased 10. When i make performance stress testing, the SOLR server CPU usage close to reach to 100%.

问题:
1 。什么原因导致CPU使用率过高?
2.是否可以降低CPU使用率,例如缓存或其他配置。

Question: 1.What causes high CPU usage? 2.Is there a way to make low CPU usage, such as cache or other configuration.

这是solrconfig中查询缓存配置的一部分。 xml
1024

This is a part section for query cache configuration in solrconfig.xml 1024

<queryResultCache
    class="solr.LRUCache"
    size="40960"
    initialSize="10240"
    autowarmCount="512"/>

<documentCache
    class="solr.FastLRUCache"
    size="40960"
    initialSize="10240"
    autowarmCount="0"/>

<enableLazyFieldLoading>true</enableLazyFieldLoading>

<queryResultWindowSize>10</queryResultWindowSize>

<queryResultMaxDocsCached>500</queryResultMaxDocsCached>


推荐答案

我管理大型索引的经验(使用自治搜索引擎),则可以预期100%CPU。因为您的索引存储在RAM中,所以没有I / O活动会减慢搜索操作的速度,CPU会尝试尽快读取RAM,这意味着接近100%的CPU。

My experience with managing a large index like you have (using Autonomy search engine), is that 100% CPU is to be expected. Because your index is stored in RAM, there is no I/O activity to slow down the search operation, and CPU will try to read through the RAM as fast as possible, meaning close to 100% CPU.

为什么要让您的搜索使用50%的CPU,所需时间是原来的2倍,对吗?

Why would you want your search to use 50% CPU, it will take 2x as long, right?

AIX有一个性能监视工具,称为nmon。在 nmon常见问题解答中,作者提醒我们

There is a performance monitoring tool for AIX called nmon. In the FAQ for nmon, the author reminds us


如果您继续使用越来越短的
时间,您最终会看到
CPU要么繁忙100%,要么繁忙100%
闲置的所有其他数字只是人类的
功能,他们没有足够快地思考
,而不得不长时间平均计算
的CPU使用率。

If you keep using shorter and shorter periods you will eventually see that the CPUs are either 100% busy or 100% idle all the other numbers are just a feature of humans not thinking fast enough and having to average out the CPU use in longer periods.

即使您没有将AIX用作操作系统,nmon FAQ中也有很多有关系统/应用程序性能监视和测量的好信息。我建议这样做,或者您可以在Google上搜索更多有关如何诊断系统性能问题的信息。

Even if you are not using AIX as your OS, there is a lot of good information in the nmon FAQ about system/application performance monitoring and measurement. I recommend it, or that you google more for how to diagnose performance issues in your system.

此外,您可能想在帖子中添加一些标签。在SO,这里有大量的活动用于基准测试和测试。

Also, you may want to add some tags to your posting. There is a fair amount of activity here at SO for bench-marking and testing.

我希望这会有所帮助。

这篇关于为什么在我使用SOLR查询所有文档时CPU使用率接近达到100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆