Hi,

I am trying to figure out how to enable compression on the Http2SolrClient
to understand if it can help or hurt our workflows.

This question is more about the client support for it, or why it's missing
so far. The server side seems to support compression, I tested with curl
'--compressed' and 'Accept-Encoding: gzip, deflate' and it seems to work ok.


First off, the old and deprecated HttpSolrClient has a flag to enable
compression which seems to inject the correct headers into the request
(Accept-Encoding: gzip, deflate), but I am looking for a non-deprecated way
using the new http2 client.

Also, my observation based on very little benchmarking is that even with
HttpSolrClient and compression enabled, the SolrCloud inter-node query
requests are using the htt2client which does not propagate the request
headers to 'ask' the server for compression. So it seems the only
compressed part is the 'final leg' of the distributed query (final query
result -> client). is this by design? I can imagine inter-node requests
being very fast so not needing compression, while the final response part
going over the wire to the client being slow, so potentially more benefits
if compression is on.
As for the benchmark results, they showed no improvement, but I don't want
to spend more time on a deprecated option.

Now for the main question. The Http2SolrClient has no compression flag
option on the builder and it explicitly sets
req.header(HttpHeader.ACCEPT_ENCODING, null); [0]. Is this by design, is
compression explicitly disabled for any reason? I tried Jira searches but
could not find anything meaningful.

I would also appreciate any feedback on enabling compression from the wider
community. Is it worth it, has anyone done some benchmarks to find that
sweet spot where enabling compression makes sense.

best,
alex


[0]
https://github.com/apache/solr/blob/main/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java#L588

Reply via email to