-
Notifications
You must be signed in to change notification settings - Fork 1
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
Artemis 3163 #15
base: io_uring_incubator
Are you sure you want to change the base?
Artemis 3163 #15
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ | |
<include>org.apache.commons:commons-dbcp2</include> | ||
<include>org.apache.commons:commons-pool2</include> | ||
<include>io.netty:netty-all</include> | ||
<include>io.netty.incubator:netty-incubator-transport-native-io_uring</include> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I similarly think its premature to distribute it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, leave it on a branch till there is a non incubator netty dependency. |
||
<include>org.apache.qpid:proton-j</include> | ||
<include>org.apache.activemq:activemq-client</include> | ||
<include>org.apache.activemq:activemq-openwire-legacy</include> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,8 @@ | |
import io.netty.channel.socket.nio.NioServerSocketChannel; | ||
import io.netty.handler.ssl.SslContext; | ||
import io.netty.handler.ssl.SslHandler; | ||
import io.netty.incubator.channel.uring.IOUringEventLoopGroup; | ||
import io.netty.incubator.channel.uring.IOUringServerSocketChannel; | ||
import io.netty.util.ResourceLeakDetector; | ||
import io.netty.util.concurrent.GenericFutureListener; | ||
import io.netty.util.concurrent.GlobalEventExecutor; | ||
|
@@ -113,7 +115,7 @@ public class NettyAcceptor extends AbstractAcceptor { | |
public static final String NIO_ACCEPTOR_TYPE = "NIO"; | ||
public static final String EPOLL_ACCEPTOR_TYPE = "EPOLL"; | ||
public static final String KQUEUE_ACCEPTOR_TYPE = "KQUEUE"; | ||
public static final String IOURING_ACCEPTOR_TYPE = "IO_URING"; | ||
public static final String IOURING_ACCEPTOR_TYPE = "IOURING"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the existing name was fine, nicer even. Per the other PR, this doesnt seem to be used for URL config, with the other boolean toggle is, so I'm not sure it matters if it has the underscore, which is actually part of the io_uring name. |
||
|
||
static { | ||
// Disable default Netty leak detection if the Netty leak detection level system properties are not in use | ||
|
@@ -150,7 +152,7 @@ public class NettyAcceptor extends AbstractAcceptor { | |
|
||
private final boolean useKQueue; | ||
|
||
private final boolean useIoUring; | ||
private final boolean useIOUring; | ||
|
||
private final ProtocolHandler protocolHandler; | ||
|
||
|
@@ -272,7 +274,7 @@ public NettyAcceptor(final String name, | |
|
||
useEpoll = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_EPOLL_PROP_NAME, TransportConstants.DEFAULT_USE_EPOLL, configuration); | ||
useKQueue = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_KQUEUE_PROP_NAME, TransportConstants.DEFAULT_USE_KQUEUE, configuration); | ||
useIoUring = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_IOURING_PROP_NAME, TransportConstants.DEFAULT_USE_IOURING, configuration); | ||
useIOUring = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_IOURING_PROP_NAME, TransportConstants.DEFAULT_USE_IOURING, configuration); | ||
|
||
backlog = ConfigurationHelper.getIntProperty(TransportConstants.BACKLOG_PROP_NAME, -1, configuration); | ||
useInvm = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_INVM_PROP_NAME, TransportConstants.DEFAULT_USE_INVM, configuration); | ||
|
@@ -384,7 +386,18 @@ public synchronized void start() throws Exception { | |
remotingThreads = Runtime.getRuntime().availableProcessors() * 3; | ||
} | ||
|
||
if (useEpoll && CheckDependencies.isEpollAvailable()) { | ||
if (useIOUring && CheckDependencies.isIOUringAvailable()) { | ||
channelClazz = IOUringServerSocketChannel.class; | ||
eventLoopGroup = new IOUringEventLoopGroup(remotingThreads, AccessController.doPrivileged(new PrivilegedAction<ActiveMQThreadFactory>() { | ||
@Override | ||
public ActiveMQThreadFactory run() { | ||
return new ActiveMQThreadFactory("activemq-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); | ||
} | ||
})); | ||
acceptorType = IOURING_ACCEPTOR_TYPE; | ||
|
||
logger.debug("Acceptor using native io_uring"); | ||
} else if (useEpoll && CheckDependencies.isEpollAvailable()) { | ||
channelClazz = EpollServerSocketChannel.class; | ||
eventLoopGroup = new EpollEventLoopGroup(remotingThreads, AccessController.doPrivileged(new PrivilegedAction<ActiveMQThreadFactory>() { | ||
@Override | ||
|
@@ -406,21 +419,6 @@ public ActiveMQThreadFactory run() { | |
acceptorType = KQUEUE_ACCEPTOR_TYPE; | ||
|
||
logger.debug("Acceptor using native kqueue"); | ||
} else if (useIoUring && CheckDependencies.isIoUringAvailable()) { | ||
channelClazz = (Class<? extends ServerChannel>) Class.forName("io.netty.incubator.channel.uring.IOUringServerSocketChannel", | ||
true, ClientSessionFactoryImpl.class.getClassLoader()); | ||
eventLoopGroup = (EventLoopGroup) Class.forName("io.netty.incubator.channel.uring.IOUringEventLoopGroup", | ||
true, ClientSessionFactoryImpl.class.getClassLoader()) | ||
.getConstructor(int.class, ThreadFactory.class) | ||
.newInstance(remotingThreads, AccessController.doPrivileged(new PrivilegedAction<ActiveMQThreadFactory>() { | ||
@Override | ||
public ActiveMQThreadFactory run() { | ||
return new ActiveMQThreadFactory("activemq-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); | ||
} | ||
})); | ||
acceptorType = IOURING_ACCEPTOR_TYPE; | ||
|
||
logger.debug("Acceptor using native io_uring"); | ||
} else { | ||
channelClazz = NioServerSocketChannel.class; | ||
eventLoopGroup = new NioEventLoopGroup(remotingThreads, AccessController.doPrivileged(new PrivilegedAction<ActiveMQThreadFactory>() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,6 +295,24 @@ The following properties are specific to this native transport: | |
a 64bit JVM is detected. Setting this to `false` will force the use of Java | ||
NIO instead of epoll. Default is `true` | ||
|
||
#### IO_Uring Native Transport | ||
> **Note:** | ||
> | ||
> This is an **INCUBATOR** transport by netty and should be treated as such. | ||
> This means it has not had thorough testing at this stage, and users that wish to use this should do their own full testing before using. | ||
> | ||
> We do encourage any feedback on this incubator transport, along with any performance reports positive or negative. | ||
> | ||
> @see https://github.com/netty/netty-incubator-transport-io_uring | ||
|
||
On supported platforms IO_Uring can be used @see https://en.wikipedia.org/wiki/Io_uring | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Supported platforms could be less vague, i.e its Linux (EDIT: which is then mentioned below...it seems superfluous to have both). I believe the name is simply io_uring rather than IO_Uring (applies here and most other places IO_Uring is used) |
||
|
||
The following properties are specific to this native transport: | ||
|
||
- `useIOUring` enables the use of io_uring if a supported linux platform is running | ||
a 64bit JVM is detected and the netty io_uring dependency is available on the classpath. | ||
Setting this to `true` will enable the use of IO_Uring. Default is `false` | ||
|
||
#### MacOS Native Transport | ||
|
||
On supported MacOS platforms KQueue is used, @see | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be optional for now until closer to the point its considered non experimental and has more than zero testing. I expect few to use it initially, and those who do can easily add it themselves, so it seems premature to make it a hard dependency for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst i agree to testing. I disagree with not including the jar. Its behind a feature toggle, by not including it youre making it much tricker for users to test/try and give feedback on. Even myself whilst i can package and deploy to lower envs the apache dist for better real testing, and getting feedback i have to jump through alot of hoops to the point it makes it prohibitive to do that and get that feedback loop if i have to customise by adding jars outside distros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would imagine it to be the same with softwaremill who run perf tests where they will just take the distro only. Which is one of the main targets we would be asking them to retest with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont consider that an issue at this stage. I think its pretty trivial to customise things like this, little different to getting the distribution if thats what you do (many dont). Certainly not a good reason to include it, for me.