I am using NEST library 6.5 from a .NET Core project. I've noticed that the library sends out an HTTP HEAD message prior to every call to get actual data.
The purpose of pinging on first usage or when a node is resurrected is to perform a quick check to ensure a node is alive before performing potentially unneccessary work such as serializing a large bulk request and writing it to the request stream.
@Russ, I disagree that it only calls it on the first usage. See below, hitting ES from my website (screenshot from Fiddler). So it's definitely hitting it with HEAD every time.
Can you share details about how you are configuring ConnectionSettings? Also are you instantiating the client each time you call it, or creating a single instance and reusing?
There's connection pooling in the BCL used by the client so that connections are reused, but the behaviour on top of this such as pinging, sniffing, caching of serialization components is part of the client code base. Take a look at the docs on connection pools for more details.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.