{"id":18446560,"url":"https://github.com/esastack/esa-httpserver","last_synced_at":"2025-04-08T00:31:54.045Z","repository":{"id":39863504,"uuid":"318103454","full_name":"esastack/esa-httpserver","owner":"esastack","description":"An asynchronous event-driven HTTP server based on netty.","archived":false,"fork":false,"pushed_at":"2022-05-24T08:13:49.000Z","size":239,"stargazers_count":87,"open_issues_count":3,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T03:11:43.492Z","etag":null,"topics":["h2c","haproxy","http2","https","httpserver","netty"],"latest_commit_sha":null,"homepage":"https://www.esastack.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esastack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-03T06:54:54.000Z","updated_at":"2024-08-11T01:51:02.000Z","dependencies_parsed_at":"2022-09-16T17:50:31.397Z","dependency_job_id":null,"html_url":"https://github.com/esastack/esa-httpserver","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esastack%2Fesa-httpserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esastack%2Fesa-httpserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esastack%2Fesa-httpserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esastack%2Fesa-httpserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esastack","download_url":"https://codeload.github.com/esastack/esa-httpserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755388,"owners_count":20990616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["h2c","haproxy","http2","https","httpserver","netty"],"created_at":"2024-11-06T07:09:41.628Z","updated_at":"2025-04-08T00:31:53.366Z","avatar_url":"https://github.com/esastack.png","language":"Java","funding_links":[],"categories":["网络编程"],"sub_categories":["Spring Cloud框架"],"readme":"# ESA HttpServer\n\n![Build](https://github.com/esastack/esa-httpserver/workflows/Build/badge.svg?branch=main)\n[![codecov](https://codecov.io/gh/esastack/esa-httpserver/branch/main/graph/badge.svg?token=C6JT3SKXX5)](https://codecov.io/gh/esastack/esa-httpserver)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.esastack/httpserver/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.esastack/httpserver/)\n[![GitHub license](https://img.shields.io/github/license/esastack/esa-httpserver)](https://github.com/esastack/esa-httpserver/blob/main/LICENSE)\n\nESA HttpServer is an asynchronous event-driven http server based on netty.\n\n## Features\n\n- Asynchronous request handing\n- Http1/H2/H2cUpgrade\n- Https\n- HAProxy\n- Epoll/NIO\n- Chunked read/write\n- Body aggregation\n- Multipart\n- Metrics\n- more features...\n\n## Maven Dependency\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.esastack\u003c/groupId\u003e\n    \u003cartifactId\u003ehttpserver\u003c/artifactId\u003e\n    \u003cversion\u003e${mvn.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Quick Start\n\n```java\nHttpServer.create()\n        .handle(req -\u003e {\n            req.onData(buf -\u003e {\n                // handle http content \n            });\n            req.onEnd(p -\u003e {\n                req.response()\n                        .setStatus(200)\n                        .end(\"Hello ESA Http Server!\".getBytes());\n                return p.setSuccess(null);\n            });\n        })\n        .listen(8080)\n        .awaitUninterruptibly();\n```\n\n## Performance\n\n### Test cases\n\n- We built an echo server by ESA HttpServer and used a http client to do the requests for RPS testing with different bytes payload(16B, 128B, 512B, 1KB, 4KB, 10KB)\n- Also we used origin netty to build a server which is same with above for RPS testing (uses the `HttpServerCodec`, `HttpObjectAggregator` handlers directly).\n\n### Hardware Used\n\nWe used the following software for the testing:\n\n- wrk4.1.0\n\n- |        | OS                       | CPU  | Mem(G) |\n  | ------ | ------------------------ | ---- | ------ |\n  | server | centos:6.9-1.2.5(docker) | 4    | 8      |\n  | client | centos:7.6-1.3.0(docker) | 16   | 3      |\n  \n\n### JVM Options\n\n```\n-server -Xms3072m -Xmx3072m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintTenuringDistribution -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:logs/gc-${appName}-%t.log -XX:NumberOfGCLogFiles=20 -XX:GCLogFileSize=480M -XX:+UseGCLogFileRotation -XX:HeapDumpPath=.\n```\n\n### Server Options\n\n- we set the value of IO threads to 8.\n\n### RPS\n\n|                | 16B       | 128B      | 512B      | 1KB       | 4KB      | 10KB     |\n| -------------- | --------- | --------- | --------- | --------- | -------- | -------- |\n|     Netty      | 133272.34 | 132818.53 | 132390.78 | 127366.28 | 85408.7  | 49798.84 |\n| ESA HttpServer | 142063.99 | 139608.23 | 139646.04 | 140159.5  | 92767.53 | 53534.21 |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesastack%2Fesa-httpserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesastack%2Fesa-httpserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesastack%2Fesa-httpserver/lists"}