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

Document recommendation about using netty-tcnative for optimizing TLS performance #344

Closed
lhotari opened this issue May 1, 2018 · 6 comments
Labels
type/documentation A documentation update

Comments

@lhotari
Copy link
Contributor

lhotari commented May 1, 2018

Using netty-tcnative boosts TLS/https performance by multiple factors.

Netty wiki explains some benefits of netty-tcnative:

Speed: In local testing, we've seen performance improvements of 3x over the JDK. GCM, which is used by the only cipher suite required by the HTTP/2 RFC, is 10-500x faster.

It should be documented as a recommendation to use netty-tcnative when using TLS/https . In modern applications, most connections use TLS.

netty-tcnative-boringssl-static is a statically compiled dependency that can be used without any prerequisites and contains native libraries for Mac OSX, Linux and Windows.

For Gradle, add:

runtime 'io.netty:netty-tcnative-boringssl-static:2.0.8.Final'

or for Maven add:

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-tcnative-boringssl-static</artifactId>
    <version>2.0.8.Final</version>
    <scope>runtime</scope>
</dependency>

The disadvantage of the multi-platform dependency is the large size of it. It's also possible to use platform specific classifiers of the netty-tcnative-boringssl-static artifact. For example, for just supporting Linux:
For Gradle, add:

runtime 'io.netty:netty-tcnative-boringssl-static:2.0.8.Final:linux-x86_64'

or for Maven add:

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-tcnative-boringssl-static</artifactId>
    <version>2.0.8.Final</version>
    <classifier>linux-x86_64</classifier>
    <scope>runtime</scope>
</dependency>

On Linux, the netty-tcnative-boringssl-static library in Maven Central doesn't support Alpine Linux / libmusl. It's compiled for glibc based Linux distributions.

@horizonzy
Copy link

I've done as you say,but id dosen't seem to work.only add a denpendency?needn't more operation?

@horizonzy
Copy link

I've done as you say,but id dosen't seem to work.only add a denpendency?needn't more operation?

It's my fault,I change the version of netty-tcnative-boringssl-static.It works,thank you.

@smaldini smaldini modified the milestones: 0.8.x Backlog, 0.9.x Backlog Feb 7, 2019
@violetagg violetagg modified the milestones: 0.9.x Maintenance Backlog, 1.0.0 Backlog May 11, 2020
@harshSE
Copy link

harshSE commented May 29, 2020

Hi, when we say netty-tcnative boosts TLS/https performance by multiple factors, is it include netty-tcnative-boringssl-static ?

@violetagg
Copy link
Member

Hi, when we say netty-tcnative boosts TLS/https performance by multiple factors, is it include netty-tcnative-boringssl-static ?

yes

@violetagg violetagg removed this from the 1.0.x Backlog milestone Jan 27, 2021
@violetagg
Copy link
Member

In the documentation it is specified that OpenSsl will be preferred when available on the system
https://projectreactor.io/docs/netty/release/reference/index.html#_ssl_and_tls_3

@jonathannaguin
Copy link

@lhotari Is there a way of specifying all platforms in Gradle? Our JARs are being built from Jenkins but then run from Docker which is a different OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/documentation A documentation update
Projects
None yet
Development

No branches or pull requests

6 participants