lightweight-webserver-java

极简 web 框架

Depends on lightweight meaning, but let me just go through them randomly: Vert.x, Akka HTTP, Jetty (the low level API, not servlet), even Tomcat and Spring Boot which embeds one of Tomcat or Jetty. Netty can be used to build a server. Spring introduced Web Flux, a Reactor Flux stream based implementation. Perhaps Dropwizard is another.
取决于轻量级含义,但让我随机浏览一下它们:Vert.x、Akka HTTP、Jetty(低级 API,而不是 servlet),甚至 Tomcat 和嵌入 Tomcat 或 Jetty 之一的 Spring Boot。 Netty可以用来搭建服务器。 Spring 引入了 Web Flux,一个基于 Reactor Flux 流的实现。也许 Dropwizard 是另一个。

My take on lightness would be 2 fold:
我对亮度的看法有两个方面:

  • non blocking servers: Vert.x, AkkaHttp, Spring Web Flux, Undertow, Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework!
    非阻塞服务器:Vert.x、AkkaHttp、Spring Web Flux、Undertow、Rapidoid - 极其快速、简单且强大的 Java Web 框架!
  • Servlet 4 implementations and Http/2 server implementations
    Servlet 4 实现和 Http/2 服务器实现

All these are easier on resources, having less threads needed to process the same number of concurrent connections and requests, less file descriptors and client ports needed for Http2, constant memory stream processing, CPU mechanical sympathy by not thrashing caches and not switching threads as often, but most of all the non blocking servers and clients offer more stability and resilience.
所有这些都更容易占用资源,处理相同数量的并发连接和请求所需的线程更少,Http2 所需的文件描述符和客户端端口更少,恒定的内存流处理,通过不破坏缓存和不频繁切换线程来实现 CPU 机械同情,但最重要的是,非阻塞服务器和客户端提供了更高的稳定性和弹性。