Skip to content

Performance Tuning

Vinay Gera edited this page Dec 9, 2019 · 4 revisions

Tuning SSL

By default, the Azure SDKs for Java use the Tomcat-native Boring SSL library to enable native-level performance for SSL operations. The Boring SSL library is an uber jar containing native libraries for Linux / macOS / Windows, and provides better performance compared to the default SSL implementation within the JDK.

Reduce Tomcat-Native SSL dependency size

By default, uber jar of Tomcat-Native Boring SSL library is used in Azure SDKs for java. To reduce the size of this dependency, you need to include the dependency with an os classifier as per netty-tcnative.

<project>
  ...
  <dependencies>
    ...
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative-boringssl-static</artifactId>
      <version>2.0.25.Final</version>
      <classifier>${os.detected.classifier}</classifier>
    </dependency>
    ...
  </dependencies>
  ...
  <build>
    ...
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.4.0.Final</version>
      </extension>
    </extensions>
    ...
  </build>
  ...
</project>

Use JDK SSL

If you'd rather use the default JDK SSL instead of Tomcat-Native Boring SSL then you need to exclcude the Tomcat-native Boring SSL library. Note, based on our tests the performance of JDK SSL is 30% slower compared to Tomcat-Native Boring SSL. You can exclude this default SSL library, as such:

<project>
  ...
  <dependencies>
    ...
    <dependency>
     <groupId>com.azure</groupId>
       <artifactId>azure-core</artifactId>
       <version>1.1.0</version>
       <exclusions>
         <exclusion>
           <groupId>io.netty</groupId>
           <artifactId>netty-tcnative-boringssl-static</artifactId>
         </exclusion>
       </exclusions>
    </dependency>
    ...
  </dependencies>
  ...
</project>
Clone this wiki locally