oci-java-sdk icon indicating copy to clipboard operation
oci-java-sdk copied to clipboard

Performance regression in versions 2.0.0 to 2.2.0 for some services (fixed in v2.3.0)

Open mricken opened this issue 3 years ago • 1 comments

In versions 2.0.0 to 2.2.0, you may encounter performance regressions when using the SDK with some OCI services. The regression surfaces itself as a 3-second increase in latency in SDK operations made to some OCI services. This performance regression was fixed in version 2.3.0.

This issue has been confirmed to impact the OCI Streaming service, and likely impacts the Email Delivery, Health Checks, NoSQL Database Cloud, Registry, Generic Artifacts, and Web Application Acceleration and Security (WAAS) services as well. This list is not comprehensive – it is possible you may encounter the issue against other OCI services as well.

The issue has been confirmed to NOT affect the OCI Object Storage service.

We have fixed this issue in version 2.3.0. If you are experiencing this issue, we recommend that you upgrade to version 2.3.0 or later (Recommended).

If you are experiencing this issue, but you cannot upgrade to version 2.3.0 or later, there are some workarounds you can do:

  • Disable support for the SDK's Expect: 100-Continue feature by doing setting the OCI_JAVASDK_JERSEY_CLIENT_DEFAULT_CONNECTOR_ENABLED environment variable to true.
# Bash
export OCI_JAVASDK_JERSEY_CLIENT_DEFAULT_CONNECTOR_ENABLED=true
  • Or, disable support for the SDK's Expect: 100-Continue feature at the client level by setting the ApacheConnectorProperties.expectContinue property to false.
ApacheConnectorProperties apacheConnectorProperties =
        ApacheConnectorProperties.builder()
                .expectContinue(false)
                .build();

ApacheConfigurator configurator = new ApacheConfigurator(apacheConnectorProperties);
// or, for clients that should not buffer requests into memory
// ApacheConfigurator configurator = new ApacheConfigurator.NonBuffering(apacheConnectorProperties);

// Initialize the client with the Apache Configurator with custom properties
StreamAdminClient streamAdminClient =
    StreamAdminClient.builder()
                     .clientConfigurator(configurator)
                     .build(provider);

// For the StreamClient, use
Stream stream = ... // retrieve using streamAdminClient.getStream

StreamClient streamClient = StreamClient.builder()
                                        .clientConfigurator(configurator)
                                        .stream(stream)
                                        .build(provider);

See "Switching to Jersey Default HttpUrlConnectorProvider" section in the ApacheConnector README.

  • Or, use SDK version 1.37.2 or earlier.
  • Or, use the SDK's raw request signer to make requests to OCI services for any requests where you are experiencing performance degradation. An example on how to use the raw request signer is here.

If you have any questions, please feel free to comment on this GitHub issue and we will be happy to help.

mricken avatar Jul 08 '21 23:07 mricken

We have fixed this issue in version 2.3.0.

If you are experiencing this issue, we recommend that you upgrade to version 2.3.0 or later (Recommended).

I left the other workarounds in the ticket description above, in case you cannot upgrade to 2.3.0 or later for some reason.

mricken avatar Jul 20 '21 22:07 mricken