要不要也来分享分享一下啊

请问es集群的搜索如何自动停止?

Elasticsearch | 作者 myhyperion | 发布于2019年03月05日 | 阅读数:1541

问题是这样的:我用php客户端进行连接查询,超时设置为20s。如果20s没返回结果就自动断开。但是有些查询会在几分钟甚至十几分钟,结果客户端断开了,服务器上还在进行搜索,最后就超过连接总数,其他客户端就连不上了。请问这种情况如何避免?有没有参数告诉服务器查询超时自动停止查询?
已邀请:

bellengao - 博客: https://www.jianshu.com/u/e0088e3e2127

赞同来自:

查询body里增加timeout参数

liubin

赞同来自:

设置
    "index.search.slowlog.threshold.fetch.debug": "500ms",
    "index.search.slowlog.threshold.fetch.info": "800ms",
    "index.search.slowlog.threshold.fetch.trace": "300ms",
    "index.search.slowlog.threshold.fetch.warn": "1s",
    "index.search.slowlog.threshold.query.debug": "2s",
    "index.search.slowlog.threshold.query.info": "5s",
    "index.search.slowlog.threshold.query.trace": "50ms",
    "index.search.slowlog.threshold.query.warn": "10s"
 
请求和召回的超时时间
 

machuan11

赞同来自:

慢查询好像没有参数可以终止执行...你可以用 get task 获取慢查询的id, 然后kill

要回复问题请先登录注册