OpenSearch/x-pack
Tim Brooks 373c67dd7a
Add DirectByteBuffer strategy for transport-nio (#36289)
This is related to #27260. In Elasticsearch all of the messages that we
serialize to write to the network are composed of heap bytes. When you
read or write to a nio socket in java, the heap memory you passed down
must be copied to/from direct memory. The JVM internally does some
buffering of the direct memory, however it is essentially unbounded.

This commit introduces a simple mechanism of buffering and copying the
memory in transport-nio. Each network event loop is given a 64kb
DirectByteBuffer. When we go to read we use this buffer and copy the
data after the read. Additionally, when we go to write, we copy the data
to the direct memory before calling write. 64KB is chosen as this is the
default receive buffer size we use for transport-netty4
(NETTY_RECEIVE_PREDICTOR_SIZE).

Since we only have one buffer per thread, we could afford larger.
However, if we the buffer is large and not all of the data is flushed in
a write call, we will do excess copies. This is something we can
explore in the future.
2018-12-06 18:09:07 -07:00
..
dev-tools Build: Merge xpack checkstyle config into core (#33399) 2018-09-05 09:17:02 -04:00
docs Docs: Add password keystore setting for email account passwords (#33409) 2018-12-06 14:35:53 +01:00
license-tools Persist generated public keys unencrypted (#34626) 2018-10-24 13:55:21 +03:00
plugin Add DirectByteBuffer strategy for transport-nio (#36289) 2018-12-06 18:09:07 -07:00
qa Fix FullClusterRestartIT#testRollupIDSchemeAfterRestart 2018-12-06 02:45:07 +01:00
test Fix test fixtures on aufs (#36105) 2018-12-03 11:01:05 +02:00
transport-client Run forbidden api checks with runtimeJavaVersion (#32947) 2018-08-22 09:05:22 +03:00
NOTICE.txt Migrate x-pack-elasticsearch source to elasticsearch 2018-04-20 15:29:54 -07:00
README.md Reorganize license files 2018-04-20 15:33:59 -07:00
build.gradle Merge remote-tracking branch 'upstream/master' into index-lifecycle 2018-10-29 14:03:55 -07:00

README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.