Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch: How to query for number of connections?

How do I ask my Elasticsearch server how many connections are open to it right now?

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

like image 646
jwayne Avatar asked Jul 05 '16 20:07

jwayne


2 Answers

The request layer uses a RESTful API, so connections don't stay open after any request has been served.

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:

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

Or are you looking for more info into the discovery layer?

like image 137
paulnsorensen Avatar answered Oct 04 '22 23:10

paulnsorensen


ES don't have number of connections.
But you can get some information about ES health, more info here:

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'
like image 22
cn007b Avatar answered Oct 04 '22 23:10

cn007b