eclipse-vertx / vert.x

Vert.x is a tool-kit for building reactive applications on the JVM
http://vertx.io
Other
14.32k stars 2.08k forks source link

Reuse existing allocators, enable experimental adaptive one and enable SSL heap pooling (Fixes #5168) #5262

Closed franz1981 closed 2 months ago

franz1981 commented 3 months ago

Fixes #5168

franz1981 commented 3 months ago

@He-Pin do you think this could be useful to use to try the adaptive pool with vertx?

zekronium commented 3 months ago

@franz1981 Why is the heap buffer not pooled, shouldn't it be a almost free lunch in performance?

franz1981 commented 3 months ago

@zekronium

Why is the heap buffer not pooled

IDK I would love to know it from @vietj

probably there's some historical reason for that but I would like to know it.

franz1981 commented 3 months ago

@vietj this is adding the option to enable heap pooling when SSL is enable, which can be a saviour with JDK SSL, see https://github.com/quarkusio/quarkus/issues/41880#issuecomment-2258734835

franz1981 commented 2 months ago

PTAL @vietj

franz1981 commented 2 months ago

Not good @vietj

Starting test: ClusteredEventBusWithSSLTest#testSendCharacter 
[vert.x-eventloop-thread-1] WARN io.netty.util.concurrent.AbstractEventExecutor - A task raised an exception. Task: io.vertx.core.impl.future.FutureBase$$Lambda/0x00007f59dc23dcd0@54c5bbbf
java.lang.NullPointerException: Cannot invoke "io.vertx.core.net.SSLEngineOptions.usePooledHeapBuffers()" because "this.sslEngineOptions" is null
    at io.vertx.core.net.impl.SSLHelper.preferredNettyAllocatorWith(SSLHelper.java:141)
    at io.vertx.core.net.impl.TCPServerBase.lambda$listen$4(TCPServerBase.java:243)
    at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
    at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
    at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
    at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
    at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
    at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62)
    at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:1583)

not sure the engine options is the right place for that configuration flag...let's see what I can do here...

franz1981 commented 2 months ago

I've decided to split in 3 separate PRs this effort, to make it easier to integrate (and test)!