
●Spring 教程下载
●SpringMVC 教程下载
●MyBatis 教程下载
●Spring Boot 教程下载
●2TB 免费 Java 学习资源

●Spring 教程下载
●SpringMVC 教程下载
●MyBatis 教程下载
●Spring Boot 教程下载
●2TB 免费 Java 学习资源
作者:阿迈达
来源:toutiao.com/a6775476659416990212
前言
本文将为大家细细讲解。
SpringBoot中的Tomcat容器
它将开发者从繁重的xml解救了出来,让开发者在几分钟内就可以创建一个完整的Web服务,极大的提高了开发者的工作效率。
Web容器技术是Web项目必不可少的组成部分,因为任Web项目都要借助容器技术来运行起来。
SpringBoot设置Undertow
我们最早的开发的项目基本都是部署在Tomcat下运行,那除了Tomcat容器,SpringBoot中我们还可以使用什么容器技术呢?
SrpingBoot已经完全继承了Undertow技术,我们只需要引入Undertow的依赖即可,如下图所示。


Tomcat与Undertow的优劣对比
Tomcat具有Web服务器特有的功能,包括 Tomcat管理和控制平台、安全局管理和Tomcat阀等。
Tomcat本身包含了HTTP服务器,因此也可以视作单独的Web服务器。
Tomcat是完全免费的,深受开发者的喜爱。

由于Undertow采用Java语言开发,可以直接嵌入到Java项目中使用。
同时, Undertow完全支持Servlet和Web Socket,在高并发情况下表现非常出色。





在相同的机器配置下,模拟相等的请求数,Undertow在性能和内存使用方面都是最优的。
并且Undertow新版本默认使用持久连接,这将会进一步提高它的并发吞吐能力。
所以,如果是高并发的业务系统,Undertow是最佳选择。
最后
Undertow在高并发业务场景中,性能优于Tomcat。
所以,如果我们的系统是高并发请求,不妨使用一下Undertow,你会发现你的系统性能会得到很大的提升。
精彩文章推荐:
喜欢就点个"在看"呗^_^
本文分享自微信公众号 - 江南一点雨(a_javaboy)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。
相关文章
暂无评论...