可以考虑使用tomcat+springmvc。
可以考虑使用springmvc + embeded jetty。
优化(运行时占用的内存、最终包的体积、启动时长)
- 删除不必要的依赖
- 配置压缩
- 调整tomcat的最大连接数
- 使用jetty替换掉tomcat(约能节省6%到12%的内存)(org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration)
# see org.springframework.boot.autoconfigure.web.ServerProperties server: compression: enabled: true tomcat: uri-encoding: UTF-8 threads: # 最少线程数 min-spare: 2 # 最多线程数 max: 8 # 最大连接数 max-connections: 16 # 队列中最大等待线程数 accept-count: 8 jetty: threads: max: 8 min: 2 maxQueueCapacity: 8 maxConnections: 10 netty: initialBufferSize: 128KB shutdown: graceful
作者:张三 创建时间:2025-01-23 22:15
最后编辑:张三 更新时间:2025-01-24 13:57
最后编辑:张三 更新时间:2025-01-24 13:57