smart-http is a relatively simple http server, the communication core uses smart-socket latest version v1.4.6
.
And because of the use of smart-socket, the server's performance is still very good, in my 4-core CPU can run out of 78W qps +.
smart-socket performance of each test are based on the server, we believe that smart-http performance will not let you down.
update content
-
Smart-socket upgrade to the latest version: 1.4.6, improve service performance.
-
Http protocol parsing algorithm optimization process for Post request.
- Example code module with the split core http function, project structure is more reasonable.
- Streamline dependence, after packing smart-http-server module is only 88KB, all rely on a total of only 171KB.
- Fix some PMD, checkstyle scanned out of the question.
- Adjust HttpRequest interface design, adaptation commons-fileupload provide analytical support for file uploads.
Fast Experience
- The introduction of smart-http depend on your Maven project.
<dependency> <groupId>org.smartboot.http</groupId> <artifactId>smart-http-server</artifactId> <version>1.0.12</version> </dependency>
- Copy the code and start.
public class SimpleSmartHttp { public static void main(String[] args) { HttpBootstrap bootstrap = new HttpBootstrap(); bootstrap.pipeline().next(new HttpHandle() { public void doHandle(HttpRequest request, HttpResponse response) throws IOException { response.write("hello world".getBytes()); } }); bootstrap.setPort(8080).start(); } }
- Browser access: HTTP: // localhost: 8080 /
At last
smart-http still in its infancy, as long as you are good enough you can guide its development path, and interested welcome into the pit.