Tomcat: NIO没有配置,是否使用?
Tomcat: is NIO used although not being configured?
根据以下文章:http://java.dzone.com/articles/understanding-tomcat-nio,了解 Tomcat 实例是否使用 NIO(而不是 BIO)的方法是寻找:
INFO: Initializing ProtocolHandler ["http-nio-8080"]
在我的 Tomcat 服务器上我有:
grep "Initializing ProtocolHandler" /opt/tomcat/logs/*
/opt/tomcat/logs/catalina.2015-02-23.log:23-Feb-2015 15:20:00.627 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
/opt/tomcat/logs/catalina.2015-02-23.log:23-Feb-2015 15:20:00.665 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
但是我的 server.xml 不包含任何告诉它使用 NIO 的内容,我的连接器如下所示:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
换句话说,我没有像上面的文章那样将协议设置为使用 org.apache.coyote.http11.Http11NioProtocol。
服务器怎么好像还在用NIO?
-- 附加信息
- Tomcat 版本:8.0.15.0
- JVM 版本:1.8.0_25-b17
- Spring 正在使用 MVC。
提前致谢
However my server.xml does contain anything that tells it to use NIO,
NIO 是 Tomcat 8.
的默认 HTTP 和 AJP 连接器实现
The default HTTP and AJP connector implementation has switched from
the Java blocking IO implementation (BIO) to the Java non-blocking IO
implementation (NIO). BIO may still be used but Servlet 3.1 and
WebSocket 1.0 features that use non-blocking IO will then use blocking
IO instead which may cause unexpected application behavior.
http://tomcat.apache.org/migration-8.html#Default_connector_implementation
根据以下文章:http://java.dzone.com/articles/understanding-tomcat-nio,了解 Tomcat 实例是否使用 NIO(而不是 BIO)的方法是寻找:
INFO: Initializing ProtocolHandler ["http-nio-8080"]
在我的 Tomcat 服务器上我有:
grep "Initializing ProtocolHandler" /opt/tomcat/logs/*
/opt/tomcat/logs/catalina.2015-02-23.log:23-Feb-2015 15:20:00.627 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
/opt/tomcat/logs/catalina.2015-02-23.log:23-Feb-2015 15:20:00.665 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
但是我的 server.xml 不包含任何告诉它使用 NIO 的内容,我的连接器如下所示:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
换句话说,我没有像上面的文章那样将协议设置为使用 org.apache.coyote.http11.Http11NioProtocol。
服务器怎么好像还在用NIO?
-- 附加信息
- Tomcat 版本:8.0.15.0
- JVM 版本:1.8.0_25-b17
- Spring 正在使用 MVC。
提前致谢
However my server.xml does contain anything that tells it to use NIO,
NIO 是 Tomcat 8.
The default HTTP and AJP connector implementation has switched from the Java blocking IO implementation (BIO) to the Java non-blocking IO implementation (NIO). BIO may still be used but Servlet 3.1 and WebSocket 1.0 features that use non-blocking IO will then use blocking IO instead which may cause unexpected application behavior.
http://tomcat.apache.org/migration-8.html#Default_connector_implementation