Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for Codec, Compressor, CompressionRegistry being Experimental. #1704

Open
carl-mastrangelo opened this issue Apr 21, 2016 · 8 comments
Assignees
Labels
experimental API Issue tracks stabilizing an experimental API P2
Milestone

Comments

@carl-mastrangelo
Copy link
Contributor

They may exist, even independent of turning off compression for public release.

@carl-mastrangelo carl-mastrangelo added this to the 1.0 milestone Apr 21, 2016
@hsaliak hsaliak added the P2 label Apr 26, 2016
@carl-mastrangelo carl-mastrangelo changed the title Codec, Compressor CompressionRegistry should be checked if they should still be experimental. Tracking Issue for Codec, Compressor, CompressionRegistry being Experimental. May 3, 2016
@carl-mastrangelo
Copy link
Contributor Author

carl-mastrangelo commented May 3, 2016

Specific usages:

  • CallOptions.getCompressor
  • CallOptions.withCompression
  • Codec
  • Compressor
  • CompressorRegistry
  • Decompressor
  • DecompressorRegistry
  • DecompressorRegistry.getAdvertisedMessageEncodings
  • ManagedChannelBuilder.decompressorRegistry
  • ManagedChannelBuilder.compressorRegistry
  • PartialForwaringServerCall.setCompression
  • ServerBuilder.compressionRegistry
  • ServerBuilder.decompressionRegistry
  • ServerCall.setCompression
  • AbstractStub.withCompression

@louiscryan
Copy link
Contributor

Primary deficiency is that what we really want is to rely on negotiation of the allowed compressors to control what is permitted and then have a simple API to control high/med/low (for some definition of those concepts).

We can't use negotiation for the first call to a service as negotiation may not have occurred so we will always need an API to allow client to assert a subset of supported compressions types for the first call.
E.g.

CallOptions.assumeInitialAllowedCompressors(....)

@louiscryan
Copy link
Contributor

Leaving experimental for 1.0 unless significant effort can be found to address the known issues and resolve this consistently across the other impls

@larry-safran
Copy link
Contributor

larry-safran commented Feb 15, 2023

Stabilize the following by removing @ExperimentalApi - Larry to do
CallOptions.withCompression
CallOptions.getCompressor
ServerCall.setCompression - make clear it is for sending
ServerCall. setMessageCompression
AbstractStub.withCompression - update javadoc to stop implying have to call decompressionRegistry

@0001vrn
Copy link

0001vrn commented Mar 3, 2023

Hi @larry-safran @ejona86
Is this feature stabilised now? if yes, which version should we use? any examples? any benchmarks?
Also, do we have any success story for lib/team using this compression in production workloads?
Thanks

@ejona86
Copy link
Member

ejona86 commented Mar 3, 2023

The built-in compression has been in reasonably wide use since 1.0. I discourage implementing custom compression methods (so avoid the registries).

@eitanbn
Copy link

eitanbn commented Mar 5, 2023

We have got bad performance results when using gzip compression

  • The overall communication speed in our web application' is slightly slower
  • The memory consumption of the agent running gRPC server increased from 2 GB to 3GB

We are using the code we have found in the internet as follows;

Server Side

server = ServerBuilder.forPort(port)
			// Set GZIP compression
			.intercept(
						 new ServerInterceptor() {
						 @Override
						 public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call, Metadata headers,
						                                                               ServerCallHandler<ReqT, RespT> next) {
						     call.setCompression("gzip");
						     return next.startCall(call, headers);
						 }
				})
			.addService(new OurGrpcServiceImpl())
			.build();

Client Side

    ourStub = OurtServiceGrpc.newStub(channel).withCompression("gzip");

or

    ourtBlockingStub = OurServiceGrpc.newBlockingStub(channel).withCompression("gzip");

Can you please advice?

Thanks,
Eitan

@ejona86
Copy link
Member

ejona86 commented Mar 6, 2023

Enabling compression will consume more memory and CPU. But it is a trade-off, because it reduces network costs and in some networks decreases latency. Use it when the trade-off is worth it to you.

larry-safran added a commit to larry-safran/grpc-java that referenced this issue Mar 6, 2023
larry-safran added a commit that referenced this issue Mar 9, 2023
… meeting (#9942)

* api,stub:Stabilize part of compression agreed to in the stabilization meeting.

addresses part of #1704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental API Issue tracks stabilizing an experimental API P2
Projects
None yet
Development

No branches or pull requests

7 participants