Smart-servlet v0.1.0 was first released and an open source servlet server prepared for 3 years

smart-servlet is a web server that implements the Servlet 3.1 specification and supports the isolated deployment of multiple applications. Although the open source is only one month long and there are still many immaturities, I hope that it can become an excellent project like Tomcat and Undertow in the future. To this goal, smart-servlet has prepared for three years:

  • 3 years ago, the open source AIO communication framework smart-socket . It provides an alternative to netty and mina for friends who are engaged in communication development, and it also takes the first step for smart-servlet development.
  • 2 years ago, the open source http server smart-http . It not only supports http 1.0/1.1, websocket protocol, but also performs well in TFB evaluation.
  • 1 month ago, open source smart-servlet. Realize servlet 3.1 specification on the basis of smart-http.

Program features

  • Zero learning cost, never met, but already know each other. Keep the user's original Tomcat and Undertow habits.
  • Simple and unpretentious, using the most advanced design techniques to create a professional server.
  • Implement Servlet core specifications: Request, Response, Session, Cookie, Dispatcher, ServletContext.
  • Plug-in design, free DIY server.
  • Continue the consistent minimalist, easy-to-use, high-performance design style.
  • Out of the box, running packages, maven local development/debugging plugins, springboot starter are all available to meet your development, deployment and other needs.

Architecture design

Smart-servlet implements the Servlet specification by inheriting HttpHandle on the basis of smart-http. This means that any smart-http service can transform ordinary http applications into servlet applications by introducing the smart-servlet core package separately, and this cost is extremely low.

Sample demo

In order to verify the standardization of smart-servlet's implementation of servlet 3.1, our demonstration examples directly transplant the projects that come with the Tomcat installation package: docs, examples. Among them, the examples project depends on some jar packages of tomcat itself, so we copied the jar packages in the ${TOMCAT_HOME}/lib directory to the examples/WEB-INF/lib directory.

Next, compile the project and run org.smartboot.servlet.starter.Bootstrap. If the console prints the following information, the startup is successful. Open the browser and visit: http://127.0.0.1:8080/examples to experience smart-servlet.

Informal evaluation

For this servlet container, users may be more concerned about its advantages compared to tomcat, for which we made a simple evaluation. Special note : This evaluation is not formal. On the one hand, smart-servlet is unfair to be both a referee and a player; on the other hand, smart-servlet is not mature enough at this stage and does not have the conditions for comparison. Therefore, the informal evaluation results provided here should be used as a publicity method for smart-servlet.

The test method we use is:

Use ab to stress test the sample request in the examples project: http://127.0.0.1:8080/examples/servlets/servlet/HelloWorldExample, the final performance result is as follows:

  • Smart-servlet performance results are 50%~100 higher than tomcat.
  • The CPU usage during the tomcat stress test is higher than 40%, and the smart-servlet is lower than 40% during the stress test.
  • The number of tomcat threads increases with the number of concurrency, and the upper limit is 200; the number of smart-servlet threads is fixed and not affected by the number of concurrency.
  • The memory overhead is basically the same.

For the detailed process, see: https://smartboot.gitee.io/book/smart-servlet/performance/test-data.html

At last

In the future, we will maintain a stable development rhythm, continue to polish the implementation details of the servlet specification, and strive to let smart-servlet run into the production environment as soon as possible. At the same time, friends in the community are very welcome to feedback improvement suggestions, or participate in the development of this project, and witness its growth together.

Guess you like

Origin www.oschina.net/news/123245/smart-servlet-0-1-0-released