简体   繁体   English

Elasticsearch:如何查询连接数?

[英]Elasticsearch: How to query for number of connections?

How do I ask my Elasticsearch server how many connections are open to it right now? 如何询问我的Elasticsearch服务器现在有多少个连接?

Is this the same as the number of sockets? 这与套接字的数量相同吗? (I don't know how to get these numbers, either) (我不知道如何获得这些数字)

And this is different from the number of clients, right, since each client may open multiple connections? 这与客户端数量不同,对,因为每个客户端可能会打开多个连接?

Could not find any info on this, though I did find that you could specify a maxSockets per client on the Elasticsearch client side: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html 找不到任何关于此的信息,但我发现您可以在Elasticsearch客户端上为每个客户端指定一个maxSockets: https ://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/ configuration.html

The request layer uses a RESTful API, so connections don't stay open after any request has been served. 请求层使用RESTful API,因此在提供任何请求后,连接不会保持打开状态。

So if you're trying to gauge how many concurrent requests Elasticsearch is serving (whether it's query, index or bulk), you probably want to monitor the thread_pool on each node: 因此,如果您要测量Elasticsearch正在服务的并发请求数(无论是查询,索引还是批量),您可能希望监视每个节点上的thread_pool:

https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html

Or are you looking for more info into the discovery layer? 或者您是否在寻找发现层的更多信息?

ES don't have number of connections. ES没有多少连接。
But you can get some information about ES health, more info here : 但您可以获得有关ES健康的一些信息,更多信息请点击此处

curl 'localhost:9200/_cat/health?v'

And you can obtain extended statistics about shards, segments, indexes, searches counts and so on... more info here : 您还可以获取有关碎片,段,索引,搜索次数等...更多信息扩展统计信息在这里

curl -XGET 'http://localhost:9200/_stats'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM