OpenSearch/libs
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
..
cli add elasticsearch-shard tool (#32281) 2018-09-19 10:28:22 +02:00
core Add a frozen engine implementation (#34357) 2018-11-07 20:23:35 +01:00
dissect Run forbidden api checks with runtimeJavaVersion (#32947) 2018-08-22 09:05:22 +03:00
grok ingest: grok remove duplicated patterns (#35886) 2018-11-26 11:13:46 -06:00
nio Add DirectByteBuffer strategy for transport-nio (#36289) 2018-12-06 18:09:07 -07:00
plugin-classloader Build: Fail if any libs depend on non-core libs (#29336) 2018-04-16 11:49:27 -04:00
secure-sm Run forbidden api checks with runtimeJavaVersion (#32947) 2018-08-22 09:05:22 +03:00
x-content Make hits.total an object in the search response (#35849) 2018-12-05 19:49:06 +01:00
build.gradle Rename elasticsearch-core to core (#31185) 2018-06-07 16:50:21 -04:00