`
eimhee
  • 浏览: 2115642 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

利用TOMCAT的日志查出SOLR的慢查询

阅读更多

TOMCAT的日志如下, 我想查出一些很慢的查询

 

写道
182460138 [http-nio-8080-exec-13] INFO org.apache.solr.core.SolrCore – [collection1] webapp=/solr4 path=/select params={spellcheck=true&mm=1&spellcheck.q=imbd+rar&qf=content^40&qf=label^5.0&qf=tags_inline^1.0&qf=taxonomy_names^2.0&qf=tos_name^3.0&qf=ts_comments^20&json.nl=map&f.content.hl.maxAlternateFieldLength=256&hl.fl=content&wt=json&hl=true&rows=10&pf=content^2.0&fl=id,entity_id,entity_type,bundle,bundle_name,label,ss_language,is_comment_count,ds_created,ds_changed,score,path,url,is_uid,tos_name,ss_field_image_uri&hl.snippets=3&start=40100&q=imbd+rar&f.content.hl.alternateField=teaser&hl.mergeContigious=true&fq=ds_created:[2013-03-06T19:27:45Z+TO+*]&fq=(access_node_me2ntd_all:0+OR+access__all:0)&ps=15} hits=36428 status=0 QTime=25

 

NOW=$(date +"%Y-%m-%d")
LOGFILE="slow_query.$NOW.log"
$(touch /var/log/tomcat6/$LOGFILE)
## 800 msec is a maximum value for solr. Let's filter everything above that
$(cat /var/log/tomcat6/catalina.out | grep 'QTime' | awk -F 'QTime=' 'int($NF) >= 800' > /var/log/tomcat6/$LOGFILE)

 

 

这段linux脚本就能查出大于800MS的记录

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics