elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.25k stars 24.86k forks source link

Make use of chunked REST response infrastructure in more APIs #89838

Open original-brownbear opened 2 years ago

original-brownbear commented 2 years ago

Now that #88311 has landed and we have the infrastructure for serializing chunked REST responses, we should make use of it to fix the massive memory usage of APIs that are known to return large responses:

elasticsearchmachine commented 2 years ago

Pinging @elastic/es-distributed (Team:Distributed)

DaveCTurner commented 1 year ago

I took a look at adding chunking to the cluster state API and it is not a small task. Yet I think it's important, we still have clients that monitor things by requesting the whole routing table sometimes and they're not going away any time soon. I don't think we can just add chunking to the routing table part, making everything else a single chunk, since you pointed out elsewhere that this moves all the serialization work back onto the transport threads. So we have to do it properly. I think we can do it in stages tho, starting at the bottom and using wrapAsXContentObject as needed to keep the work off of transport threads until we get to the top:

DaveCTurner commented 1 year ago

I think that's everything but the various search APIs, for which I think we should ask for help from the search team. Should we open a separate issue for the search team about that, and then close this one?

elasticsearchmachine commented 1 year ago

Pinging @elastic/es-search (Team:Search)

javanna commented 1 year ago

Heya, I added the Search label so that this is on our radar, given that the only remaining task is ours.

javanna commented 1 year ago

We now have a Search meta issue (#95661), so I am removing the search area label from this one.