Access 9300 port through Js

(Konidala Satyanarayana) #1

The present Elasticsearch js allows me to put data using the http port(9200). Is there any way I can access the transport layer port through javascript so that I can upload my data even faster?


(Magnus Bäck) #2

No, there's no JavaScript library that supports to the transport protocol.

(David Pilato) #3

Adding to this that I'm not sure you will notice any difference.
May be you are not using the Bulk API which makes you think that REST layer is slow?

(Konidala Satyanarayana) #4

I was under an opinion that the transport layer is much more faster than the rest layer.

(Jörg Prante) #5

For Java, transport protocol uses a binary serialization and saves the overhead of HTTP.

But what is that overhead? You have some HTTP headers in text form. Then, you have some overhead by using HTTP over TCP. Then you have many parallel connections.

In practice, such overhead is negligible, it compensates well with

  • bulk mode: send more than one operation per request
  • compression
  • persistency of connections (do not open/close connections for each request/response)
  • configuring a local area network with low latency, without network packet collisions, and enough bandwidth

These performance factors weigh much more than HTTP protocol overhead.

The Java transport protocol is not quite usable for non-JVM languages (the implementation effort would be enormous). Even with Java transport protocol, you still have protocol overhead - data types are encoded in some extra bits and TCP overhead is there as well. And you still have parallel connections.

The most important areas to gain performance using HTTP are

  • shorter headers, compressed headers in requests and responses (binary only protocol)
  • less number of connections by multiplexing sessions on a single connection
  • better aligning with TCP streams
  • prefetching nested content (e.g. "server hints", image loading for HTML pages)

HTTP/2 is addressing these areas. This is the reason why HTTP/2 would be a more efficient solution also for Elasticsearch.

(system) #6