OpenSearch/qa
Armin Braun ba2d70d8eb
Serialize Outbound Messages on IO Threads (#56961) (#57080)
Almost every outbound message is serialized to buffers of 16k pagesize.
We were serializing these messages off the IO loop (and retaining the concrete message
instance as well) and would then enqueue it on the IO loop to be dealt with as soon as the
channel is ready.
1. This would cause buffers to be held onto for longer than necessary, causing less reuse on average.
2. If a channel was slow for some reason, not only would concrete message instances queue up for it, but also 16k of buffers would be reserved for each message until it would be written+flushed physically.

With this change, the serialization happens on the event loop which effectively limits the number of buffers that `N` IO-threads will ever use so long as messages are small and channels writable.
Also, this change dereferences the reference to the concrete outbound message as soon as it has been serialized to save some more on GC.

This reduces the GC time for a default PMC run by about 50% in experiments (3 nodes, 2G heap each, loopback ... obvious caveat is that GC isn't that heavy in the first place with recent changes but still a measurable gain).
I also expect it to be helpful for master node stability by causing less of a spike if master is e.g. hit by a large number of requests that are processed batched (e.g. shard snapshot status updates) and responded to in a short time frame all at once.

Obviously, the downside to this change is that it introduces more latency on the IO loop for the serialization. But since we read all of these messages on the IO loop as well I don't see it as much of a qualitative change really and the more predictable buffer use seems much more valuable relatively.
2020-06-02 16:15:18 +02:00
..
ccs-unavailable-clusters Remove seeds depedency for remote cluster settings (#52829) 2020-02-26 10:17:25 -07:00
die-with-dignity RestHandlers declare handled routes (#52123) 2020-02-09 22:48:32 -07:00
evil-tests upgrade to Lucene 8.6.0 snapshot (#56661) 2020-05-13 14:25:16 +02:00
full-cluster-restart Unmute FullClusterRestartIT#testSearch. 2020-05-28 10:55:17 -07:00
logging-config ThreadPool and ThreadContext are not closeable (#43249) (#49273) 2019-11-19 13:15:16 -07:00
mixed-cluster Move bwcVersions extension property to BuildParams (back port) (#56381) 2020-05-11 09:39:13 +02:00
multi-cluster-search [7.x] Backport ValuesSourceRegistry and related work (#54922) 2020-04-16 16:54:46 -04:00
no-bootstrap-tests Prevent unexpected native controller output hanging the process (#56685) 2020-05-13 22:57:00 +01:00
os Re-enable plugin and upgrade bats tests (#51565) (#56999) 2020-05-20 08:34:05 -07:00
remote-clusters Define aarch64 packaging test tasks (#55228) 2020-04-15 13:39:18 +01:00
repository-multi-version Move bwcVersions extension property to BuildParams (back port) (#56381) 2020-05-11 09:39:13 +02:00
rolling-upgrade [7.x] ILM: add support for rolling over data streams (#57295) (#57515) 2020-06-02 11:55:23 +01:00
smoke-test-client Serialize Outbound Messages on IO Threads (#56961) (#57080) 2020-06-02 16:15:18 +02:00
smoke-test-http Enable decompression of response within LowLevelRestClient (#55413) (#56820) 2020-05-15 16:50:45 +01:00
smoke-test-ingest-disabled Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
smoke-test-ingest-with-all-dependencies Rename MetaData to Metadata in all of the places (#54519) 2020-03-31 17:24:38 -04:00
smoke-test-multinode Set feature flags for IndexTemplatesV2 in top-level gradle file (#53898) 2020-03-20 14:52:22 -06:00
smoke-test-plugins [7.x] Lazy test cluster module and plugins (#54852) (#55087) 2020-04-13 10:53:35 -05:00
translog-policy Omit translog bwc test before 6.3.0 with default distro (#57266) 2020-05-28 12:38:30 -07:00
unconfigured-node-name Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
verify-version-constants Move bwcVersions extension property to BuildParams (back port) (#56381) 2020-05-11 09:39:13 +02:00
wildfly Define aarch64 packaging test tasks (#55228) 2020-04-15 13:39:18 +01:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00